nightfox79 nightfox79 - 1 year ago 69
SQL Question

How to display a number with a space between currency and the number

I can't find a way to display a number with a space between the currency and the number.
If I use the follow syntax:

select to_char(99.90,'FML90D99') from dual;

I get the following result:


However the result I need is with a space between the dollar sign and the number

$ 99.9

How can I achieve this?
If I use the following you get an error

select to_char(99.90,'FML 90D99') from dual;
ORA-01481: invalid number format model

Answer Source

You can use this (by defining your currency):

SELECT to_char(800, 'FML999G990D00', 'NLS_CURRENCY=''$ ''') FROM dual;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download