I have a database table with these two columns:
This table can store amounts in va
How about?
select 12345 amount, 2 decimalPlaces, substr( to_char( 12345 ), 1, length (to_char( 12345 ) ) - 2 ) || '.' || substr( to_char( 12345 ), -2 ) result from dual /
amount decimalPlaces result ---------- ------------- ------ 12345 2 123.45