0){ $tempDecimalDigits = $decimalDigits + 1; $number = substr(sprintf("%.{$tempDecimalDigits}f", $number), 0, -1); } else if($decimalDigits == 0){ $number = (int)$number; } } return $number; } public static function isInt($number){ return is_numeric($number) && !is_float($number) ? true : false; } public static function isFloat($number){ return is_numeric($number) && !is_int($number) ? true : false; } public static function isNumeric($number){ return is_numeric($number); } }