« Back to History
EngineeringValidations.php
|
20260721_154032.php
Initial Bulk Import
Copy Code
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; class EngineeringValidations { public static function validateFloat(mixed $value): float { if (!is_numeric($value)) { throw new Exception(ExcelError::VALUE()); } return (float) $value; } public static function validateInt(mixed $value): int { if (!is_numeric($value)) { throw new Exception(ExcelError::VALUE()); } return (int) floor((float) $value); } }