Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Leading zeros for numbers between 0 and 1

Leading zeros for numbers between 0 and 1

From: Michael Mauch <michael.mauch_at_gmx.de>
Date: Sat, 17 Nov 2001 14:12:09 +0000
Message-ID: <p7r5t9.hm.ln@elmicha.333200002251-0001.dialin.t-online.de>


Hi,

is there a way to get leading zeros for numbers between 0 and 1, e.g. "0.12" instead of ".12"?

I know I can use NLS_NUMERIC_CHARACTERS to set the characters printed for the decimal and thousands separators, but I can't find a way to automatically get these leading zeros.

I wrote an flatfile export utility in Pro*C, and it was a real hassle to get these leading zeros:

  1. First I find out which columns are numeric (once for each query).
  2. Then for each field (each row, each column!) I have to check if that column is numeric, than check if the first character is not a digit (and not a minus sign) and then perhaps prepend/insert a zero.

So is there a better way?

Regards...

                Michael Received on Sat Nov 17 2001 - 08:12:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US