NumberHelper extension

Extension methods on num for converting to human-readable formats.

on

Properties

asPercentageText String

Available on num?, provided by the NumberHelper extension

Example:
no setter
asPlusText String

Available on num?, provided by the NumberHelper extension

Example:
no setter
text String

Available on num?, provided by the NumberHelper extension

If fractionDigits is 0, the value is formatted with no decimal places. Otherwise, it is formatted with the specified number of decimal places, and trailing zeros are removed.
no setter
toReadableBytes Readable

Available on num?, provided by the NumberHelper extension

Converts the number to a human-readable byte format.
no setter
toReadableNumber Readable

Available on num?, provided by the NumberHelper extension

Converts the number to a human-readable number format.
no setter

Methods

toPercentageText([String sign = "%"]) String

Available on num?, provided by the NumberHelper extension

Example:
toPlusText([String sign = "+"]) String

Available on num?, provided by the NumberHelper extension

Example:
toText([int fractionDigits = 2]) String

Available on num?, provided by the NumberHelper extension

If fractionDigits is 0, the value is formatted with no decimal places. Otherwise, it is formatted with the specified number of decimal places, and trailing zeros are removed.