Formating floating point numbers

edited 4:45PM in FastReport 3.0
Hi,
I need to format currency numbers like as a spreadsheet:
10      -> 10,00
10.20   -> 10,20
1024.16 -> 1.024,16
9.03    -> 9,03

P.S.- I had to use comma as a point and point as a decimal separator.

Thank you.

Comments

  • edited 4:45PM
    Try this one:
    Format('%.2n', [floating-point variable name]);

    PS: %n works depend on your system locale setting
    (ThousandSeparator and DecimalSeparator global variable)
  • edited 4:45PM
    Thank you for your helpl but it doesn't work all the way.

    If I use a point as a point it's OK, but since I had to use a comma as a point the function always put a point.

    Regards.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.