Answers for "php string to float cent to 2 decimals"

PHP
2

php parse float 2 decimal places

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

Convert String to Float in PHP

phpCopy<?php
$mystring = "0.5674";
echo("This float number is of string data type ");
echo($mystring);
echo("n");
$myfloat = number_format($mystring, 4);
echo("Now, this float number is of float data type ");
echo($myfloat);
?>
Posted by: Guest on April-23-2021

Code answers related to "php string to float cent to 2 decimals"

Browse Popular Code Answers by Language