----- Original Message ----- 
From: "Daniel Carrera" <dcarrera / math.umd.edu>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Thursday, May 01, 2003 12:55 PM
Subject: Re: ljust, rjust...


> I usually do
> >> sprintf "%05d", 15
> => "00015"
> >> sprintf "%05d", "15"
> => "00015"
> 
> How about making 'sprintf' so that you can write:
> 
>   "15".sprintf "%05d"  # --> "00015"

We already have something like this... it just
happens to be backwards.

  "%05d" % "15"    # "00015"

But this doesn't address the original poster's
desire for generality, I guess.

Hal