[racket] Filling number

From: Laurent (laurent.orseau at gmail.com)
Date: Thu Sep 27 10:26:00 EDT 2012


Looking for a friend of real->decimal-string (which does only partly what
you want), I see that the nightly builds include a family of value
formatters like ~a, ~v, etc.
You probably want ~r, for example:
> (~r 42 #:min-width 5 #:pad-string "0")

They have many options that should fit your needs.


On Thu, Sep 27, 2012 at 4:11 PM, <heraklea at gmx.de> wrote:

> Hello friends,
> I search the docu, but I cannot find how I can fill a number with leading
> zeros or trailing zeros.
> I am using number->string and would like fill the missing zeros.
> Yours,
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120927/11ae49cd/attachment.html>

Posted on the users mailing list.