Ok, so I'm more of a designer and math was never my strong point.
I'm keeping a record of points for a sort-of members database.
Now most of the time, members are assigned whole numbers, 1 point, 2 points.
Occasionally, they get quarter or half a point assigned (0.25, 0.5)
So I set the points column in MySQL to DECIMAL(4,2)
Throughout the website I now see 1.00, 2.00, 2.25
What I'd like to see is 1, 2, 2.25
In other words, truncated if the two decimal places are zeros.
Can I solve this by changing the column type or do I have to do something when I query the data?
I'm keeping a record of points for a sort-of members database.
Now most of the time, members are assigned whole numbers, 1 point, 2 points.
Occasionally, they get quarter or half a point assigned (0.25, 0.5)
So I set the points column in MySQL to DECIMAL(4,2)
Throughout the website I now see 1.00, 2.00, 2.25
What I'd like to see is 1, 2, 2.25
In other words, truncated if the two decimal places are zeros.
Can I solve this by changing the column type or do I have to do something when I query the data?
Comment