descriptive narrative of the problem
Oracle assumes the storage number (20,2) data, 0 in the database is 0.00, 2.1 in the database is 2.10, 3.88 is stored as 3.88,
Assume that the corresponding display is taken directly from the database:
0 2.1 3.88 the reserved two decimal places will change, assuming that the database remains consistent:
Workaround
To preserve two-bit valid decimals:
SELECT TO_CHAR(3.2,‘FM99999999999990D00‘FROM DUAL
There's too much nonsense, just a sample:
Examples of references:
SelectTo_char (A,' 99d90 '), To_char (A,' 90d90 '), To_char (A,' fm90d99 '), RTrim (To_char (A,' fm90d99 '), To_char (0,' D ')) from(Select -A fromDualUnion All Select 50.57 fromDualUnion All Select 5.57 fromDualUnion All Select 0.35 fromDualUnion All Select 0.4 fromDualOrder byATo_cha To_cha To_cha RTRIM (------ ------ ------ ------.35 0.35 0.35 0.35.40 0.40 0.4 0.4 5.57 5.57 5.57 5.57 50.00 50.00 50. 50 50.57 50.57) 50.57 50.57
Documentation:
Specific references: click here
Official Document: Oracle Format doc
Sample References: Example
Oracle converts numbers to formatted strings