Focal Point
currency format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6291081492

August 04, 2008, 05:36 AM
SureshKumar
currency format
Hi All,
Is there anyway we can change the currency format?

Example Indian Rupees would be displayed as 1,23,456.78

US $ would be 123,456.78

Canada $ would be 123 456,78


Webfocus 8002M, 8009
OS: Windows7
August 04, 2008, 06:38 AM
Danny-SRL
Suresh,

As far as I know, WF provides only CDN (continental decimal notation) where the decimal point is a comma and the separator is a period.
If you want something more, use the FTOA function to create an alpha field and then EDIT.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 05, 2008, 11:53 AM
Leah
quote:
US $ would be 123,456.78

Canada $ would be 123 456,78


As Daniel says, there is the CDN, is there any reason you don't want a comma in the Canadian, or was that an error on your post?


Leah
August 06, 2008, 04:09 AM
Danny-SRL
Leah,

I don't think it is an error: there a many countries where the 1000-separator is a space. And in switzerland it is the apostrophe '. Even in calculators!!!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 07, 2008, 02:16 PM
GCohen
Did you try to define your data in the MFD as a curreny, and the name of the currency.
e.g.
FIELDNAME=PRICE,ALIAS=PR, FORMAT=D9.2,CURR=country_name-from_list ,$

Search the documentation for how to find the list of currencies.(search is in upper right hand of this page)


Release 7.6.9
Windows
HTML
August 09, 2008, 10:58 AM
Mikel
Punctuating Numbers with CDN (WF761):

SET CDN = OFF    -   123,456.78
SET CDN = ON     -   123,456,78
SET CDN = SPACE  -   123 456,78
SET CDN = QUOTE  -   123'456,78
SET CDN = QUOTEP -   123'456.78
Ref: WF 761 - Punctuating numbers - SET CDN

Not CDN value for:  1.23.456,78 (Indian number format)
(The Indian number format groups the lowest order 3 digits (thousands) and then every 2 digits after that)

Regards,
Mikel

This message has been edited. Last edited by: Mikel,


WebFOCUS 8.1.05, 8.2.01
August 10, 2008, 01:16 AM
Danny-SRL
Mikel,

Very nice. This shows that there is one acronym that has to be changed:
Not RTFM, but RAVOTFM (Read All Versions Of The Focus Manual)


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 11, 2008, 05:41 AM
<JG>
Suresh, as Danny suggested the only option is to convert it to alpha and manipulate it

Best would be to either create your own user written subroutine or set up a DEFINE FUNCTION

For example set up the following function so that it is executed by your profile
(that way it will always be available).

DEFINE FUNCTION INDIAVAL (VALUE/D20.2)
A1/A22 = FTOA(VALUE, '(D20.2c)', 'A22');
A2/A27 = EDIT(A1,'99,99,99,99,99,99,99,999999');
A3/A27 = CTRAN(27, A2, 32, 44, 'A27');
INDIAVAL/A27 = TRIM('L',A3,27, ',', 1, 'A27');
END
-RUN

you can then call it via a DEFINE or COMPUTE at any time.

for example

TABLE FILE CAR
PRINT
COMPUTE TVALUE/D20.2=SALES * DEALER_COST + 0.99;
COMPUTE INDIAVAL/A27= INDIAVAL(TVALUE); AS 'Value,in,Rupees'
BY COUNTRY
IF SALES NE 0
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=INDIAVAL, JUSTIFY=RIGHT,$
END
August 11, 2008, 05:48 AM
SureshKumar
Thanks a lot for the info Mikel.
was a great piece of info for CDN attributes.

I had a doubt if i could just specify country name or something as a parameter to get the currency values in that format.


Webfocus 8002M, 8009
OS: Windows7