[fpc-devel] format function

Vinzent Hoefler JeLlyFish.software at gmx.net
Thu Oct 12 14:22:10 CEST 2006


On Thursday 12 October 2006 12:16, Andrea Mauri wrote:
> Dear all,
> this is my first mail to this mailing list, I'm not sure this is the
> correct one to post this topic.
> I noticed a strange behavior of the format function. I'm not sure it
> can be considered as a bug.
> If I use
> format('%.3f', [-0.0001])
> the resulting string is
> -0.000
> and not
> 0.000
> Why?

Hmm, I'd guess that's because the (original) number is negative and the 
sign is not changed by rounding or chopping off digits.


Vinzent.




More information about the fpc-devel mailing list