Re: Get Count of Decimal Places

From: joel garry <>
Date: Thu, 13 Mar 2008 11:20:31 -0700 (PDT)
Message-ID: <>

On Mar 13, 10:55 am, webtourist <> wrote:
> I have some number data in table like this:
> .050485436893203883495145631
> 234.040388349514563106796116505
> i.e. very large decimal places..
> I'd like to update them and ROUND them all to 8th decimal.
> How to get the number of decimal places ? or I have to do this via
> to_char, substr etc....
> thanks

Oracle has a particular definition for storing numeric values. Normally, one keeps the value precisely, then rounds particularly during manipulation or display. But you might have some particular requirement, so perhaps you should say what it is. I've seen quite a bit of ridiculous argument as users don't understand when and where rounding should be done, especially when they have wrong formulae with Excel spreadsheets, and it always winds up coming back to me to explain why the db is right and their spreadsheets are wrong.

SQL has a round function:

The Concepts manual explains your options:

The SQL manual also describes the datatype in more detail:

You should learn to search the manuals at


-- is bogus.  '...unsolicited suggestions you "feel are
helpful" are helpful only to your sense of superiority.
You're not alone in this, either. Your "helping" impulse and your
sister's resistance both originate in the same human need: to matter.
The only way you're going to change this habit is to know this impulse
for what it is. Recognize it so you can be more conscious of the ways
you choose to assert yourself, and do so only when it's your business
to (the oversimplified version: when it's about you; when you're
asked; in emergencies). That's the only time it's appropriate, and
also, conveniently, the only time it actually works.
Put your "nitpicking" to that test and I think you'll see how freely,
and wrongly, your attempts to help have crossed these boundaries. This
is the light that will show you the limits next time. ' - "Carolyn
Received on Thu Mar 13 2008 - 13:20:31 CDT

Original text of this message