Hello,
Thank you very much for your e-mail.
Your code is much too long for that. StrFormat is generic function that is very useful for
doing number to string conversions.
function DateNumToStr( dn )
{
return WriteIf( dn >= 1000000, "20", "10" ) + StrFormat("%06.0f", dn % 1000000 );
}
dn = DateNum();
bdn = BeginValue( dn );
edn = EndValue( dn );
begstr = DateNumToStr( bdn );
endstr = DateNumToStr( edn );
printf( begstr + "\n" );
printf( endstr + "\n" );
Best regards,
Tomasz Janeczko
amibroker.com
So this is how I Solved it:
eb = Nz(EndValue( BarIndex() ));
bb = Nz(BeginValue( BarIndex() )) ;
MonStr = NumToStr(monarray[bb],1.0, separator=false, roundAndPad = False);
monStrLen = strlen(MonStr);
montwodigit = writeIf(monStrLen == 1, ("0"+MonStr), MonStr);
printf("montwodigit" + montwodigit+ "\n");
DayStr = NumToStr(Dayarray[bb],1.0, separator=false, roundAndPad = False);
DayStrLen = strlen(DayStr);
Daytwodigit = writeIf(DayStrLen == 1, ("0"+DayStr), DayStr);
printf("Daytwodigit" + Daytwodigit+ "\n");
Begin_yyyymmdd = NumToStr(Yeararray[bb],1.0, separator=false, roundAndPad = False)+
montwodigit+
Daytwodigit;
Same way its done for End_yyyymmdd
Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon