[Lazarus] FormatFloat('#,##.00', -1) -> .-1,00

John Landmesser jmlandmesser at gmx.de
Mon Sep 7 17:38:18 CEST 2015


ok , you are right,  but see the problem: a negative value contains the 
thousandseperator where there is no value >1000

example:

thousandseperator := '|';

FormatFloat('#,##.00', -10);

result:
*|*-10,00

On 07.09.2015 17:14, Werner Pamler wrote:
>>  the function FormatFloat delivers a bad formatted negative value 
>> with(!) the dot from ThousandSeparator.
>>
>> In sysint.inc i found:
>>
>>    { Character that is put every 3 numbers in a currency }
>>   ThousandSeparator : Char absolute 
>> DefaultFormatSettings.ThousandSeparator *deprecated*;
>
> The format '#,##0.00' means: Format the number with two decimal 
> places, even if it is an integer. Replace the dot by 
> DefaultFormatSettings.DecimalSeparator. If the number is greater than 
> 1000 (or less than -1000) add a thousand separator, replace the comma 
> by the DefaultFormatSettings.ThousandSeparator. The '#' identifies 
> optional digits which will be shown only when needed. The '0' 
> identifies digits which will be shown even if the corresponding digit 
> would be 0 (i.e. if the format string were '0,000.00' then the number 
> 12 would be displayed as '0.012,00' if DecimalSeparator is '.' and 
> ThousandSeparator is '.').
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150907/defbd8d1/attachment-0003.html>


More information about the Lazarus mailing list