[Lazarus] formatfloat negative zero (-0)
Andrea Mauri
andrea.mauri.75 at gmail.com
Mon Jul 7 14:13:42 CEST 2014
Dear all,
using formatfloat function I got an unexpected behaviour.
If I round negative numbers I can get as result of formatfloat = '-0'.
I think it is a bug, since -0 has no meaning, zero is zero.
How can I make a workaround?
e.g.
label1.Caption:= FormatFloat('0.###', strtofloat(edit1.Text));
if in edit1.text I have -0.000001 I got -0 as result while I would like
to get 0.
Is it a bug, what can I do?
Best regards,
Andrea Mauri
Lazarus 1.2.5 r45573M FPC 2.6.4 i386-win32-win32/win64
More information about the Lazarus
mailing list