Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 377 Bytes
(use srfi-13)
(define (pad-number n zeroes)
(define (pad num len)
(let ((str (if (string? num) num (number->string num))))
(if (equal? str "")
""
(if (>= (string-length str) len)
str
(string-pad str len #\0)))))
(let ((len (string-length (->string n))))
(if (= len zeroes)
n
(pad n zeroes))))