Retrieving formatted numbers from Oracle

wxdqz

New Member
Hi Dudes,

I serched for nearly an hour now in the forum but I couldn't find a regarding thread :(

What I have is a Oracle 8i with data, which my application doesn't write (read only) and several number fields in it - NUMER(18,2) e.g.

As the application is goint to be multilingual, I have coded a cool system to format numbers according to the compulsory format of the country.

The first thing I wounder is, why do I get something lik this, when I read from a NUMBER field (as you can see it's defined as string).

["CRD_LIM_AMT"]=>
array(1) {
[0]=>
string(8) "180000,00"
}
...
Secondly, when I make a select in sqlplus and have a number '6500' e.g. I get 6500,00!
But the var_dump in php gives me 6500.
Thats a big problem when reformatting.

I already have a solution on select level:
select REPLACE(CURR_PRINC_AMT, ',' ,'.') CURR_PRINC_AMT
but I wounder wheter there is a possibility to fill the decimal numbers with zeros, in the above described case. Or any other possibility to configure PHP or Oracle regarding this behaviour.
thx
 
Back
Top