PHP 5.4.31 Released

doubleval

(PHP 4, PHP 5)

doublevalPseudonim pentru floatval()

Descrierea

Această funcție este pseudonim pentru: floatval().

Istoria schimbărilor

Versiunea Descriere
4.2.0 doubleval() a devenit un pseudonim al floatval(). }nainte de aceasta a existat numai doubleval().

add a note add a note

User Contributed Notes 2 notes

up
1
mike at onethingsimple dot com
4 months 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);
?>
up
-1
Anonymous
3 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