# tablepress/3.4/libraries/vendor/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php

TablePress – Tables in WordPress made easy, version 3.4. 34 lines.

- Page: https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.4/raw/libraries/vendor/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php
- Modified: 2025-04-29T05:06:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php#L10-L20`.

```php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Engineering;

use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;

class EngineeringValidations
{
	/**
				 * @param mixed $value
				 */
				public static function validateFloat($value): float
	{
		if (!is_numeric($value)) {
			throw new Exception(ExcelError::VALUE());
		}

		return (float) $value;
	}

	/**
				 * @param mixed $value
				 */
				public static function validateInt($value): int
	{
		if (!is_numeric($value)) {
			throw new Exception(ExcelError::VALUE());
		}

		return (int) floor((float) $value);
	}
}

```
