Recent

Author Topic: How to format memo for currency?  (Read 6175 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
How to format memo for currency?
« on: November 09, 2012, 04:42:12 pm »
Hi,
Sorry for all the questions.

Anyway, Iam porting a delphi app that used fast reports and the group footer sum field was formatted for currency
i.e.
if positive it shows $56.78 and if negative it shows (56.78)  and it also pads the values if needed for example if the
dataset value was 56.7  it would display $56.70

Thanks in advance.

Snorkel
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: How to format memo for currency?
« Reply #1 on: November 09, 2012, 04:47:22 pm »
oh, forgot to add I tried to use the formatting string FR for Dephi uses:
%2.2m

but it does not work the values display like this:
%255259
for a sum of 55056.36 and 202.63

***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: How to format memo for currency?
« Reply #2 on: November 09, 2012, 05:09:10 pm »
This was not easy to find, so here is the solution, hope it helps someone else:

Right click on the memo object and select variable format, then select custom and paste this in:

$#,##0.00;($#,##0.00);-;-
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

 

TinyPortal © 2005-2018