Why
not use this:
Filter = 1;
SetOption("NoDefaultcolumns",False);
DateNumber = ParamDate("Date",Now(1)); // To
provice test DateNum
DateString = NumToStr(DateTimeConvert( 2, DateNumber),formatDateTime);
AddTextColumn(DateString, "DateNum");
Buy = 1;
herman
Monday,
May 14, 2007, 10:23:37 AM, you wrote:
>
|
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
|
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
__,_._,___