public static function PHPExcel_Calculation_MathTrig::ROUNDUP in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php \PHPExcel_Calculation_MathTrig::ROUNDUP()
* ROUNDUP * * Rounds a number up to a specified number of decimal places * *
Parameters
float $number Number to round: * @param int $digits Number of digits to which you want to round $number * @return float Rounded Number
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ MathTrig.php, line 931
Class
- PHPExcel_Calculation_MathTrig
- PHPExcel_Calculation_MathTrig
Code
public static function ROUNDUP($number, $digits) {
$number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
$digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits);
if (is_numeric($number) && is_numeric($digits)) {
$significance = pow(10, (int) $digits);
if ($number < 0.0) {
return floor($number * $significance) / $significance;
}
else {
return ceil($number * $significance) / $significance;
}
}
return PHPExcel_Calculation_Functions::VALUE();
}