Answers for "i want more thand default decimal point in php float"

PHP
3

php parse float 2 decimal places

$num = 5;
$num = number_format($num, 2);
Posted by: Guest on June-18-2021
1

php random float number with 2 decimal places

$decimals = 2; // number of decimal places
$div = pow(10, $decimals);

// Syntax: mt_rand(min, max);
mt_rand(0.01 * $div, 0.05 * $div) / $div;
Posted by: Guest on March-02-2021

Code answers related to "i want more thand default decimal point in php float"

Browse Popular Code Answers by Language