Home » Developer & Programmer » Forms » Currency Group Separator
Currency Group Separator [message #179801] Wed, 28 June 2006 16:12 Go to next message
prash_says
Messages: 5
Registered: May 2006
Location: India
Junior Member

Hello Friends,

I am developing a Custom Form.

Here i have a Database Field(Amount), where data type is Number.
I am using Format Mask: 999,999,999.00

This form is used in Multi Org and the filed is can perform DML operations.

I currency to be displayed as Multi org Currency Group Separator.
Can any one please tell me how to do this.

I have tried used a function, It works fine only when i query.
But when i update it it errors out.
So i am using Format Mask at present, but this will have standard format which will not work for Muli Currency.

Thanks,
Prash
Re: Currency Group Separator [message #180019 is a reply to message #179801] Thu, 29 June 2006 18:08 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
@others: Does Prash have to use a character field for display and do a to_char AFTER setting the required NLS format to populate it? Or will the currency format on a numeric field work as long as he has the correct NLS setting?

David
Re: Currency Group Separator [message #180020 is a reply to message #179801] Thu, 29 June 2006 18:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
From Oracle's SQL Reference Manual
Quote:

TO_CHAR, number conversion
Syntax TO_CHAR(n [, fmt [, 'nlsparams'] ])

Purpose

Converts n of NUMBER datatype to a value of VARCHAR2 datatype, using the optional number format fmt. If you omit fmt, n is converted to a VARCHAR2 value exactly long enough to hold its significant digits. For information on number formats, see the section "Format Models" .

The 'nlsparams' specifies these characters that are returned by number format elements:

decimal character
group separator
local currency symbol
international currency symbol

This argument can have this form:
'NLS_NUMERIC_CHARACTERS = ''dg''
 NLS_CURRENCY = ''text''
 NLS_ISO_CURRENCY = territory '

The characters d and g represent the decimal character and group separator, respectively. They must be different single-byte characters. Note that within the quoted string, you must use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit 'nlsparams' or any one of the parameters, this function uses the default parameter values for your session.

Example I
SELECT TO_CHAR(-10000,'L99G999D99MI') "Amount"
	FROM DUAL
Amount
--------------------
         $10,000.00-

Note how the output above is blank padded to the left of the currency symbol.

Example II
SELECT TO_CHAR(-10000,'L99G999D99MI',
	'NLS_NUMERIC_CHARACTERS = '',.''
	NLS_CURRENCY = ''AusDollars'' ') "Amount"
	FROM DUAL
Amount
--------------------
AusDollars10.000,00-


David
Re: Currency Group Separator [message #180132 is a reply to message #180020] Fri, 30 June 2006 04:49 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
The escaped quotes aren't necessary, David Wink :
SQL> SELECT TO_CHAR(-10000,'L99G999D99MI',
  2     'NLS_NUMERIC_CHARACTERS =,.     NLS_CURRENCY =AusDollars ') "Amount"
  3     FROM DUAL
  4  /

Amount
--------------------
AusDollars10.000,00-


MHE

[Updated on: Fri, 30 June 2006 04:49]

Report message to a moderator

Previous Topic: go to last record + 1
Next Topic: Duplicate Record
Goto Forum:
  


Current Time: Fri Sep 20 08:25:12 CDT 2024