Does Oracle store trailing zeroes for Number data type?

The existence of the trailing zeros is a display issue, not a storage issue. The trailing zeros are not significant, and anyway the internal format of the numbers is immaterial as long as the values are correct. There is no value difference between 10 and 10.00000.

If you need trailing zeros you can always use formatting when converting the values for display. For example:

System.out.printf("%10.4d\n", decimalValue);

If the problem is differences in scale, you can set the scale to the appropriate value before comparing.

Leave a Comment