Home » SQL & PL/SQL » SQL & PL/SQL » two decimal place
two decimal place [message #257064] Tue, 07 August 2007 08:59 Go to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
select cost from basket where id='1'

cost
------
10
12345.2
123432345.1

If i want to have the result like the below, how can i do?>

cost
------
10.00
12345.20
123432345.10
Re: two decimal place [message #257065 is a reply to message #257064] Tue, 07 August 2007 09:05 Go to previous messageGo to next message
Amersfoort
Messages: 3
Registered: August 2007
Junior Member
select to_char(costs,'FM999999999.00')
from basket where id='1'


edit: changed the numberformat to remove first blanks

[Updated on: Tue, 07 August 2007 09:13]

Report message to a moderator

Re: two decimal place [message #257067 is a reply to message #257064] Tue, 07 August 2007 09:09 Go to previous messageGo to next message
muddasani.s
Messages: 10
Registered: June 2007
Junior Member

Hi

U modify the field datatype as number(p,s).
where p=precesion,
s=scale
so u take s=2

i.e cost number(15,2).

regards
mudda


Re: two decimal place [message #257072 is a reply to message #257065] Tue, 07 August 2007 09:14 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
no, it does not work
Re: two decimal place [message #257074 is a reply to message #257064] Tue, 07 August 2007 09:16 Go to previous message
bbvic
Messages: 24
Registered: October 2006
Junior Member
it works..
FM999999999.00..

thanks
Previous Topic: Select Dummy Rows?
Next Topic: performing function on multiple rows
Goto Forum:
  


Current Time: Sat Dec 03 05:56:18 CST 2016

Total time taken to generate the page: 0.04330 seconds