Skip to content
Advertisement

use a custom number format for money in HTML

i have an interactive report in my apex page with numbers (money) in it, the default money format is U.S which is like this :

###,###,###,###.##

what i need is this :

### ### ### ###,##

is there a way to do so in HTML or in CSS or JAVASCRIPT

Advertisement

Answer

The display format in an apex report is determined by 2 parameters:

  • Appearance > Format Mask of the column in your interactive report
  • Decimal and Group separator set in the database session.
Decimal and group separator

In oracle this is determined at session level. You want , as decimal and space as group separator. To change this for your database session run the following statement.

ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ', ';
  • To change this for your entire application, set the following in Shared Components > Security > Database Session > Initialization PL/SQL Code
EXECUTE IMMEDIATE q'!ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ', '!';
  • To just set this for the page you have your report on you can either use an application process (with condition Current Page is contained within expression) = “your page” or a before header process to execute the EXECUTE IMMEDIATE statement above
Format Mask

The Number Format Models documentation might give you some clues here: 9is a NUMBER, D is the decimal separator, G is the group separator. So you’re looking for 999G999G999G999D99

SELECT TO_CHAR(9866166747393/100,'999G999G999G999D99') from dual;

98 661 667 473,93

Set this as Appearance > Format Mask of the column in your interactive report.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement