CRM_Utils_Number
class CRM_Utils_Number
Class CRM_Utils_Number
Methods
static float
createRandomDecimal(array $precision)
Create a random number with a given precision.
static float
createTruncatedDecimal(int|float $keyValue, array $precision)
Given a number, coerce it to meet the precision requirement. If possible, it should keep the number as-is. If necessary, this may drop the least-significant digits and/or move the decimal place.
static int
formatUnitSize(string $size, bool $checkForPostMax = FALSE)
Some kind of numbery-looky-printy thing.
Details
at line 48
static float
createRandomDecimal(array $precision)
Create a random number with a given precision.
at line 65
static float
createTruncatedDecimal(int|float $keyValue, array $precision)
Given a number, coerce it to meet the precision requirement. If possible, it should keep the number as-is. If necessary, this may drop the least-significant digits and/or move the decimal place.
at line 92
static int
formatUnitSize(string $size, bool $checkForPostMax = FALSE)
Some kind of numbery-looky-printy thing.