Skip to main content
Version: Next

roundDecimalFormat()

function roundDecimalFormat(
value,
decimals,
options): string

Rounds number to a fixed number of decimals, then formats as a human readable string

Parameters

ParameterTypeDefault valueDescription
valuenumberundefinedValue to round
decimalsnumber1Number of digits after the decimal point to keep
optionsobject{}-
options.keepSmallValues?booleanundefinedIf true, will keep any small value as-is which would be rounded to 0, defaults to false

Returns

string

rounded number as a human readable string