Is there a way to specify that a double datatype will always have 2 points after the decimal point like currency usually has (oracle db) ?
that is:
100 will be converted to 100.00
101.1 will be converted to 101.10
Tried casting it and setting precision-scale but no luck with that it doesnt add default decimal point and zeroes
SELECT CAST((600.2) AS NUMERIC(28,2)) FROM DUAL;
Gives me 600.2
SELECT to_char(101, '999.90') FROM DUAL;
SELECT to_char(101.1, '999.90') FROM DUAL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With