This question already has an answer here:
- How to strip trailing zeros in PHP 14 answers
- Show a number to 2 decimal places 21 answers
This questions is kinda confusing, but here I am telling you the exact problem I have. In database I have a column with datatype double(10,6), means the value can have upto 6 decimals depending on each user.
Some user have a value 5.22 say in this column.
Now when I echo this value in php, I want it to show 5.22 or 7.256 not 5.220000 or 7.256000.
I hope its clear. Thanks.
</div>