Welcome Guest, Not a member yet? Register   Sign In
Format decimal removing anything before the decimal point
#6

[eluser]hepp[/eluser]
A simpler way to just remove everything before the dot

Code:
<?php
$val = 0.37;
$val = substr($val, strpos($val, '.')+1); // $val is now 37
?>


Messages In This Thread
Format decimal removing anything before the decimal point - by El Forum - 05-02-2008, 06:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB