-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
In both Number::getSuffixNotation() and MagnitudeSuffix::__toString(), the nearest SI magnitude is computed using:
3 * floor($magnitude/3)It would be convenient if either Number or MagnitudeSuffix could provide such information.
In my case I am using PHP's round() with negative precision parameter to round a given number to k, M, G, etc. without any decimal part:
$suffixed = Number::n(
round(
$input_number,
-1 * (3 * floor(Number::n($input_number)->getMagnitude()/3))
)
)
->getSuffixNotation();Metadata
Metadata
Assignees
Labels
No labels