[Lazarus] formatfloat negative zero (-0)

Lukasz Sokol el.es.cr at gmail.com
Wed Jul 9 13:44:12 CEST 2014


On 09/07/14 11:17, Andrea Mauri wrote:
>> 

> 
> Dear Lukasz, thanks, anyway I reported this problem using formatfloat
> just because it has the same behaviour of TFloatField.DisplayFormat
> and it was easier to provide a sample code. I do not use FormatFloat
> so I cannot use your function.
> 
> As I wrote I think that this behaviour is a bug and not a feature
> (see excel and libreoffice behaviour). Someone can check the delphi
> behaviour?
> 
> Andrea
> 

As a matter of fact, I can... on Turbo Delphi 2006 (free edition)...

and the behavior is as you said it should be.

(i.e. FormatFloat eats the minus if the content of the edit is smaller than expected by the format string)

With FormatFloat format string '0.###' :

Input: -0.001     Output: -0.001
Input: -0.0001    Output: 0.000  

So it _is_ not the same as Lazarus/FPC has;

Guess it's time to call to the bugtracker then...

-L.





More information about the Lazarus mailing list