DayTripperID DayTripperID - 1 year ago 143
MySQL Question

MySQL DECIMAL(3,2) trailing zeros not showing

enter image description hereHow can I get trailing zeros for type DECIMAL(3,2) to show?

For example, if I insert value 1.50, queries show it as 1.5 instead. See screenshot below. The schema is on the left, the query is on the right, and the results are displayed at the bottome. Thanks!

Answer Source

Assuming you are asking about what you observe in MySQL directly, it should first be noted that even though the trailing zeros may be missing in the query output, the precision internally should not be affected.

If you want to retain the full width of the DECIMAL, you can try either of the following:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download