I have a procedure I am doing that displays odds but the client wants only significant digits to be shown. So, 1.50 would show as '1.5' and 1.00 would show as '1'.
How can I get MySQL to not display trailing zeros;
i.e. in the database:
Odds
1.500
23.030
2.000
4.450
would display as
1.5
23.03
2
4.45
Thanks for any help
EDIT: I would use the answer below by Christopher McGowan instead - adding 0 to the value, which is better, instead.
It's important to check there is actually a decimal point if doing trimming.
So I think you'd want to use:
Docs for the TRIM function.