Skip to content

Commit

Permalink
Update DataNormalizer.php (exponent)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator authored Mar 20, 2024
1 parent b9f2802 commit fb359a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Util/Filter/DataNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,12 @@ public static function number(mixed $number) : ?string
'Exponent is too large'
);
}
// check additional exponent
$additionalExponent = 0;
if (!$isDecimalPoint && str_contains($mantissa, '.')) {
$additionalExponent = strlen(explode('.', $mantissa)[0]);
}
$exponent = $exponent + $additionalExponent;
$mantissa = str_replace('.', '', $mantissa);
if ($isDecimalPoint) {
// - is decimal point, convert mantissa
Expand Down

0 comments on commit fb359a6

Please sign in to comment.