Re: using decimal points in oracle

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 6 Aug 2001 20:27:45 +0200
Message-ID: <997122466.15769.0.pluto.d4ee154e_at_news.demon.nl>


"Nicholas Mudie" <nmudie_at_chello.com> wrote in message news:uUtb7.6556$UG6.616865_at_amsnews02.chello.com...
> Hi Everyone,
>
> I have a column in my database which displays information like this:
>
> 312.200463260440213486618344769832761638
> 71.84514585513286835742982511836200263337
> 54.88363435721267112681207905366965929238
> and so on..........
>
> I want to show this value to the max of two decimal places. (i.e 54.88 )
 How
> would I do this??
>
> I display the oracle data using cgi scripts and call an embedded SQL
> statement like this:
>
> $getfactor = $dbh->prepare(qq{select customer_id, pkg, p_domain, network,
> country, bytes, factor from _at_tablename WHERE factor > '$fa
> ctor%' and pkg like '%$sqlpkg%' and p_domain like '%$sqldom%' and network
> like '%network%' order by bytes desc});
>
> If I know the oracle command to take these values to two decimal places I
> could use it in the above statement.
>
> Many thanks,
> Nick
>
> Applications Engineer
> Chello Broadband
> Amsterdam
> Holland
>
> 0611012214
>
>

Check the to_char function in the sql reference manual.

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Mon Aug 06 2001 - 20:27:45 CEST

Original text of this message