[REBOL] Re: [Nifty Function of the Day] Pad
From: AJMartin:orcon at: 16-Aug-2003 10:04
And an even shorter version:
Pad: func [
"Pads a value with leading zeroes or a specified fill character."
Value [any-type!] "The value."
Width [integer!] "The desired width."
/With Fill [char!] "With the specified Fill character."
] [
head insert/dup Value: form Value any [Fill #"0"] Width - length? Value
]
Thanks to Bo, DocKimbel, Gabriele and Gregg!
Andrew J Martin
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/