This library allows to work with numeric data in different ways: to round them to decimal places, to shorten them with adding postfixes or to get digit count.
number.round(int or float value): float value
Rounds the number to the nearest integer and returns the result:
number.roundToDecimalPlaces(int or float value, int decimalPlaces): float value
Rounds the number to the nearest integer, limiting the result to the specified number of decimal places and returns the result:
number.shorten(int or float value, int decimalPlaces): float value
Converts given value to a string with K, M, G, T, P, E, Z or Y postfixes in dependence on the size of the number, leaving given count of decimal places:
number.getDigitCount(int or float value): float value
Returns count of digits in decimal number: