float floatval ( mixed $var ) - Gets the float value of a string.
<?php
$var = '122.34343The';
$float_value_of_var = floatval($var);
echo $float_value_of_var; // 122.34343
?>
Or you can do a cast with (float):$rootbeer = (float) $InvoicedUnits;
No comments:
Post a Comment