Skip to main content
Version: 1.x

@microsoft/fast-colors > roundToPrecisionSmall

roundToPrecisionSmall() function

Will return infinity if i*10^(precision) overflows number note that floating point rounding rules come into play here so values that end up rounding on a .5 round to the nearest even not always up so 2.5 rounds to 2

Signature:
export declare function roundToPrecisionSmall(i: number, precision: number): number;

Parameters

ParameterTypeDescription
inumberthe number to round
precisionnumberthe precision to round to
Returns:

number