[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] StrMid(NumToStr(1040928),4,3);



PureBytes Links

Trading Reference Links

Thanks,

anyone knows where i can find a explanation for formatstr
in *StrFormat( formatstr, ... )

Stephane


*

Tomasz Janeczko a écrit :

> Stephane,
>
> Why not just check what NumToStr returns before assuming bug ?
>
> StrMid operates on STRINGs. You can get same results if strings passed 
> are the same
> in your case they are NOT. This is so because NumToStr by default 
> returns strings
> with thousand separators.
>
> If you investigated a little bit more:
>
> string=NumToStr(1040928);
> mm= StrMid(string,4,3);
> test= StrMid("1040928",4,3);
>
> you would find that NumToStr(1040928)
> gives you sting like this:
> "1,040,928.000"
>
> As you can see there are thousands separators there.
> Because "1,040,928.000" is different string than "1040928"
> characters 4..6 are different too.
>
> If you want string without separators you have to specify this in your
> NumToStr call http://www.amibroker.com/f?numtostr
>
> string=NumToStr(1040928,1,False);
> mm= StrMid(string,4,3);
> test= StrMid("1040928",4,3);
>
> You can use StrFormat for more control 
> http://www.amibroker.com/f?strformat
>
> string=StrFormat("%.9g",1040928);
> mm= StrMid(string,4,3);
> test= StrMid("1040928",4,3);
>
> Best regards,
> Tomasz Janeczko
> amibroker.com





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/