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

[eluser]gtech[/eluser]
im sure there is a better way but this would work:

$str = "0.37";
$numbers = explode('.', $str);
$before = $numbers[0];
$after = $numbers[1];

or you could use a regular expression.


Messages In This Thread
Format decimal removing anything before the decimal point - by El Forum - 05-01-2008, 08:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB