How can I cut unnecessary zeros at the end of a floating point value in PHP, like the following for example:
3.0 --> 3
12.56300 --> 12.563
etc.
How can I cut unnecessary zeros at the end of a floating point value in PHP, like the following for example:
3.0 --> 3
12.56300 --> 12.563
etc.
You can just use (double) or (float) without (string)
echo (float)$input;