Answers for "php number always two digits"

PHP
1

two digits after decimal point in php

echo round(520.34345, 2);   // 520.34
echo round(520.3, 2);       // 520.3
echo round(520, 2);         // 520
Posted by: Guest on May-31-2021
1

laravel number add 0 before

<?php
$num = 4;
$num_padded = sprintf("%02d", $num);
echo $num_padded; // returns 04
?>
Posted by: Guest on April-25-2020

Code answers related to "php number always two digits"

Browse Popular Code Answers by Language