/ Published in: PHP
I use this snippet to force a number to 2 decimal places.
Eg, For prices, PHP rounds the number 22.20 to 22.2. This code forces a zero on the end if there isn't 2 decimal places already.
Eg, For prices, PHP rounds the number 22.20 to 22.2. This code forces a zero on the end if there isn't 2 decimal places already.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php ?>