Answers for "php string to float with 2 decimal"

PHP
10

fix to 2 decimal places php

return number_format((float)$number, 2, '.', '');
Posted by: Guest on October-23-2020
3

php float 2 decimais

$foo = "105";
echo number_format((float)$foo, 2, '.', '');
Posted by: Guest on June-18-2020
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 = floatval($mystring);
echo("Now, this float number is of float data type ");
echo($myfloat);
?>
Posted by: Guest on April-23-2021
-1

php float to number format 2

100,000
100,000.00
100,000.000
100.000,00
Posted by: Guest on March-30-2021

Code answers related to "php string to float with 2 decimal"

Browse Popular Code Answers by Language