fixedWidthNumber
lib.strings.fixedWidthNumber
Docs pulled from | This Revision | 10 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"
Noogle detected
Implementation
The following is the current implementation of this function.
fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);