Home » Developer & Programmer » Reports & Discoverer » converting the number to string (report 10g)
converting the number to string [message #485171] Mon, 06 December 2010 10:51 Go to next message
Amar_bu
Messages: 32
Registered: July 2010
Location: riyadh
Member
Hi
I wanna convert the amount of money from number to string such as 144.5 to be one hundred fourty four point five is there any function or i have to write my function?

how could i put new line in the string?
for example if i have 'SAB Bank' || 'Riyadh'
but i want SAB bank to be displayed in line and riyadh in line. could i achive that ?
thanks
Re: converting the number to string [message #485172 is a reply to message #485171] Mon, 06 December 2010 11:04 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If numbers are not decimal, there's an easy way to do that:
SQL> select to_char(to_date(144, 'j'), 'jsp') words from dual;

WORDS
----------------------
one hundred forty-four

SQL>

For more information, either search the Internet or read this AskTom discussion. Basically, you'll need to write your own function.

As of "new line", no problem either:
SQL> select 'SAB Bank' || chr(10) || 'Riyadh' bank_name from dual;

BANK_NAME
---------------
SAB Bank
Riyadh


SQL>
Re: converting the number to string [message #485174 is a reply to message #485171] Mon, 06 December 2010 11:09 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Search this site for 'spell number' or 'amount in words'
2)
SQL> select 'SAB Bank' || chr(10)|| 'Riyadh' from dual;

'SABBANK'||CHR(
---------------
SAB Bank
Riyadh


However since you're using reports you'll almost certainly find it easier to work with two seperate fields.
Previous Topic: Report Page Alteration
Next Topic: Report Server
Goto Forum:
  


Current Time: Thu Apr 25 17:12:40 CDT 2024