1. Glenn Barber
  2. PowerBuilder
  3. Saturday, 14 July 2018 22:56 PM UTC

Our application has to support reports where each line on the report could have values which could be in different currencies.

To represent the currency format correctly we have been using the expression

'\' + currsymb + '#,##0 ;[RED](' + '\' + currsymb + '#,##0); 

This works great when the currency symbol is a single character like $,  however US$ as a symbol doesn't work.  What happens is that the value in the column loses 2 digits of precision. (e.g $800,000 becomes US$8,000).

I suspect that we have to parse this out and provide an escape for each character when there is more than one.  Supplying the '\' in the currsymb value doesn't appear to work.

This is the behavior in 12.6, and will confirm in 2017R2

Anyone have a solution for this, or is there a feature in 2017R2 that we can use going forward.

Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 July 2018 05:10 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

When I set the value of column currsymb to ‘U\S$’, the data ‘800,000’ then can be displayed as ’US$800,000’. Please see the below pic for information.

 

Regards,

Ken

 

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Sunday, 15 July 2018 15:26 PM UTC
  2. PowerBuilder
  3. # 2

The format specification allows the use of any characters in the format but they must be escaped using backslash.  Some like $ (actually i think only) do not need this, so it is not consistent.

Also, not all currencies are formatted the same.  some have the currency character(s) before the value and some after. Some have a space before or after the characters/symbols, some do not.  Most currencies have 2 decimal places but some have none, and some have 3.

Rather than construct the format in the datawindow, we retrieve back the format from the database.  In our case we use a view and construct the format dynamically  based on the options set in our currency table.

some examples:

AED -   "\D\h\s\.\ #,##0.00;[RED](\D\h\s\.\ #,##0.00)"  - space and period


AMD - "#,##0.00\A\M\D;[RED](#,##0.00\A\M\D)"  - no space

AWG - "\ƒ\ #,##0.00;[RED](\ƒ\ #,##0.00)"  - has space after symbol

 

NOTE: powerserver WEB does NOT handle the backslash in field format correctly.  I have not checked to see if powerserver mobile works correctly, but i assume it does not work correctly either.

 

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.