From: Daniel Baird Date: 2006-05-29T19:32:42+09:00 Subject: Re: Equivalent of Python zfill? ------=_Part_12422_11046584.1148898758994 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 5/29/06, Pe=F1a, Botp wrote: > > fr Peter: > # But if "0"*7 is the 'normal' way of doing this, it's OK with me. > > in ruby in general, the shorter and simpler, the faster. > > kind regards -botp > > it might be worth profiling something like this: # at start of code lotsazeros =3D '0' * 1000 # various places in code seven_zeros =3D lotsazeros[0..6] three_thousand_and_ten_zeros =3D lotsazeros * 3 + '0' * 10 no idea how this performs, just thought it'd be worth trying.. ;D --=20 Daniel Baird http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things That Suck) ------=_Part_12422_11046584.1148898758994--