In PHP I have decimal numbers that may or may not have trailing zeros.
For example
1
1.1
43.87
How do I make sure that all these numbers have exactly two decimal places like this:
1.00
1.10
43.87
You should use number_format():
number_format(1.1, 2);