PHP 7.0.6 Released

doubleval

(PHP 4, PHP 5, PHP 7)

doublevalAlias of floatval()

Description

This function is an alias of: floatval().

User Contributed Notes

mike at onethingsimple dot com
2 years ago
// The code above will throw an error, I believe you meant to
// echo number_format($mynum) instead of $mynumstr
// variable $mynum holds the value of the string processed by
// doubleval

<?php
$mynumstr
= "100,000,000.75";
$mynum = doubleval(str_replace(",","",$mynumstr));
echo
"Normal Value:".number_format($mynum);
?>
Anonymous
5 years ago
We can convert the value to normal decimal value...
<?php
$mynumstr
= "100,000,000.75";
$mynum = doubleval(str_replace(",","",$mynumstr));
echo
"Normal Value:".number_format($mynumstr);
?>
To Top