{"record":{"id":"ba8c6cf761d122c8","repo":"PHPOffice/PhpSpreadsheet","slug":"num-ba8c6c","errorCode":"#NUM!","errorMessage":"#NUM!","messagePattern":"#NUM!","errorType":"error_code","errorClass":"PhpOffice\\PhpSpreadsheet\\Calculation\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php","lineNumber":49,"sourceCode":"        }\n\n        return (float) $value;\n    }\n\n    public static function validateInt(mixed $value): int\n    {\n        if (!is_numeric($value)) {\n            throw new Exception(ExcelError::VALUE());\n        }\n\n        return (int) floor((float) $value);\n    }\n\n    public static function validateRate(mixed $rate): float\n    {\n        $rate = self::validateFloat($rate);\n        if ($rate < 0.0) {\n            throw new Exception(ExcelError::NAN());\n        }\n\n        return $rate;\n    }\n\n    public static function validateFrequency(mixed $frequency): int\n    {\n        $frequency = self::validateInt($frequency);\n        if (\n            ($frequency !== FinancialConstants::FREQUENCY_ANNUAL)\n            && ($frequency !== FinancialConstants::FREQUENCY_SEMI_ANNUAL)\n            && ($frequency !== FinancialConstants::FREQUENCY_QUARTERLY)\n        ) {\n            throw new Exception(ExcelError::NAN());\n        }\n\n        return $frequency;\n    }","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php#L31-L67","documentation":"Error \"#NUM!\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}