split decimal
Posted: Fri Apr 23, 2010 10:57 am
I have the following code:
I need a way to split the decimal so that I can get the two parts but I'm not returning the first part (which in this case is a 1).
Code: Select all
$mins = 75;
$mins = $mins / 60; // returns 1.25
list($hrs, $mins) = split(".", $mins, 2); //I want to return 1 and .25 separately
$mins = $mins * .60; // should return 15