nf(value, leftDigits, rightDigits)
Utility function for formatting numbers into strings. There are two versions, one for formatting floats and one for formatting ints. The values for the digits, left, and right parameters should always be positive integers.
nf()
is used to add zeros to the left and/or right of a number. This is typically for aligning a list of numbers. To remove digits from a floating-point number, use the ceil()
, floor()
, or round()
functions.
Type: function
Parameter(s):
- value {Number}:
The Number to convert
- leftDigits {Number}:
- rightDigits {Number}:
Returns:
-
{String}:
The formatted string