I am trying to convert a date number to a year+month+day number for better display.
It worked before, but for May 11, I got this error:
1070511 + 19000000 = 20070512 instead of 20070511.
Here is a piece of code to demonstrate this calculation error:
---------------------------------------------------------
filter = 1;
daten = StrFormat("%f", 1070511 + 19000000);
AddTextColumn(daten, "DateNum");
buy = 1;
---------------------------------------------------------
The column will display 20070512.00000, not 20070511 as you would expect.
I understand that in AFL, all numbers are in double type and integer is converted when used. However, this doesn’t seem to be a rounding error since the result is exactly 20070512.00000, not something like 20070511.71332.
I am using 4.90.5.
Have anyone seen this before?
Thanks,
- Mark
|