back to Overview

_.pad()

Converts a number into a string by 'padding' it with leading zeros until it has at least the given number of digits.
Util module only.

Syntax

_.pad(digits, number)

Parameters

digits
the minimum number of digits for the number
number
the number to format
(return value)
the number converted to a string and padded with zeros

Description

Converts a number into a string by 'padding' it with leading zeros until it has at least the given number of digits.

See also..

Comments

comments powered by Disqus

back to Overview

Functions