| 2nd Decimal Place not appearing [message #561115] |
Thu, 19 July 2012 00:58  |
 |
praveen240881
Messages: 36 Registered: February 2012
|
Member |
|
|
Dear Experts
I need your guidance please.
I am using Oracle Forms 6i. In my program unit i write into a .CSV and .TXT File. Here if the amount is 100.00 then it prints as 100 only. That is if the 2nd decimal digit is 0 it doesnt print it.
For example
10.00 -->10
10.01--> 10.01
10.10-->10.1
10.12-->10.12
I used to_char(nvl(&amount,0),'9999999.99')
so if query select to_char(nvl(10.10,0),'9999999.99') from dual, then i get the output as 10.10.
Do you think this is a problem with Oracle forms or SQL or the formatting of .TXT & .CSV.
Praveen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: 2nd Decimal Place not appearing [message #561160 is a reply to message #561150] |
Thu, 19 July 2012 04:02  |
c_stenersen
Messages: 253 Registered: August 2007
|
Senior Member |
|
|
What you're sending in to your function is a string, but the function expects a number, so it does an implicit conversion. Then the functions appends that number to your varchar2 variable which means that it's doing another implicit conversion to get the number as a string again. Your to_string should be in the function, not in the function call.
(That you didn't check your little example for syntax errors is a different matter. For the future, please do.)
|
|
|
|