IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#30413 - 10/01/09 10:34 AM Currency
astefanelli Offline
Junior Member

Registered: 07/02/09
Posts: 6
Loc: PA
New to Planet Press so I sure this is simple but I am at my wits end.

My data is a number 123456.00. I would like it to print in a currency format. $123,456.00

Any help?

Top
#30414 - 10/01/09 11:33 AM Re: Currency
Anonymous
Unregistered


This is simple thanks to OL Experts who published a PlanetPress Talk library doing exacltly this.

So you need to 1) download the Amount functions library, 2) import it in your PlanetPress Design document using the Global Functions Library Manager and 3) call the function inside a Design object:

1) Download the library from Objectif Lune's Resource center:
http://www.objectiflune.com/OL/en-CA/Dow...Cat=PressTalk#1


2) Import the desired function in your PlanetPress Design document. See this post for more details:
http://www.objectiflune.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=93;t=000022

3) Use the function with the appropriate syntax.
Once the function is imported, double click on the function name to see some useful comments on how to use it.

Hope this helps!

Benoit

Top
#30415 - 10/01/09 01:58 PM Re: Currency
astefanelli Offline
Junior Member

Registered: 07/02/09
Posts: 6
Loc: PA
Thank you so much I think I am almost there. I still get a not enought or too many parameters error.

In my data selection (custom) line I have this,


=@formatamountcurr(@(9,1,18))

Can you help?

Top
#30416 - 10/01/09 02:05 PM Re: Currency
Anonymous
Unregistered


Open the Global functions folder of your PlanetPress Design document and double click on the function name. The comments should explain how to use the function.

Code:
function @FormatAmountCurr(&Amount:currency,&ThousandSep:string): string
  %---------------------------------------------------------
  % Function that formats an amount in a currency by adding-
  % separators at correct positions.                       -
  %---------------------------------------------------------
  % Input:  &Amount      Amount to format (currency).      -
  %         &ThousandSep Separator to use (string).        -
  % Output: Formatted amount.  Ex: 1,445,848.00 (string)   -
  % Uses:   @FormatAmountStr                               -
  %---------------------------------------------------------
  % Written by:   Marty Jacques, Objectif Lune             -
  % Last updated: February 9, 2006                         -
  %---------------------------------------------------------
  &result:=@FormatAmountStr(curtostr(&Amount),&ThousandSep)
endfunction()
So the 2nd argument of this function is the character you want to use as the thousand separator. You could use ',' for example.

Also note that this function uses @FormatAmountStr. Therefore you should also import this function from the library to your PlanetPress Design document.

Hope this helps!

Ben

Top
#30417 - 10/01/09 02:13 PM Re: Currency
astefanelli Offline
Junior Member

Registered: 07/02/09
Posts: 6
Loc: PA
I really appreciate your help.
now i get...


PTK0048: Function not found with line &_AdvDataSel_:=...
PTK0083: Object [$_InternalTempObj_] is empty

Top
#30418 - 10/01/09 02:20 PM Re: Currency
Anonymous
Unregistered


Hi,

Since @FormatAmountCurr uses @FormatAmountStr, @FormatAmountStr must be defined before @FormatAmountCurr.

1. Open the Global functions folder, then drag @FormatAmountStr above @FormatAmountCurr.

2. Press F5 to refresh the document.

Hope this helps!

Benoit

Top
#30419 - 10/05/09 02:29 PM Re: Currency
astefanelli Offline
Junior Member

Registered: 07/02/09
Posts: 6
Loc: PA
Thank you so much for your help. I finally got back to this today and that was the final piece of the puzzle.


Thanks again.

Top