How to add extra space in between the current and decimal value when using currency

When we are using currency option on a control pega is showing like below

CAD123

expected is

CAD 123

Do we have any easy way to do it? Adding extra space when we don’t have the current symbol available with us.

@MandeepRawat

One way to achieve the expected format of “CAD 123” is to use a custom format mask with a space between the currency symbol and the value.

To do this, you can follow these steps:

  1. Open the section where the currency control is located.
  2. Select the currency control, and go to the Presentation tab in the Properties panel.
  3. Under the Format Mask section, select Custom.
  4. In the Custom Format field, enter the desired format mask, which in this case would be “¤ #,##0.00” (note the space between the currency symbol and the number format).
  5. Save and test the section.

This should display the currency value in the format of “CAD 123” instead of “CAD123”.

Or Follow the Screenshot Option

Change the dropdown Currency symbol (e.g. $) to 3 character currency code (e.g. USD)

Or We can use the JS with the following link

Thanks

Sumit K.

@MandeepRawat

import java.util.Currency;
import java.util.Locale;

public class CurrencyDemo {
public static void main(String args) {
Locale indiaLocale = new Locale(“en”, “IN”);
Currency indiaCurrency = Currency.getInstance(indiaLocale);
System.out.println("INR currency code: " + indiaCurrency.getCurrencyCode());
System.out.println("INR currency symbol: " + indiaCurrency.getSymbol());
}
}

we had INR present with us and used the getSymbol to fetch the symbol value and formed my desired string.