query
On this page

fixedWidthNumber

lib.fixedWidthNumber

Docs pulled from | This Revision | 22 minutes ago


Format a number adding leading zeroes up to fixed width.

Inputs

width
1. Function argument
n
2. Function argument

Type

fixedWidthNumber :: int -> int -> string

Examples

lib.strings.fixedWidthNumber usage example

fixedWidthNumber 5 15
=> "00015"
(lib.strings.fixedWidthNumber)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);