On Thu, Jul 18, 2002 at 03:47:35PM -0400, darren chamberlain wrote:
> big_number.commify(" ",5);
>
> Of course, we aren;t commifying any more.

How about chunk(size) to turn something into chunks.  Then you could
combine with join() like so:

  [% big_number.chunk(3).join(',') %]

No wait, numbers would need to be chunked from the right, so we could
use a negative index for that:

  [% bignum = 1234567 %]
  [% bignum.chunk(-3).join(',') %]   1,234,567
  [% bignum.chunk(3).join(',') %]    123,456,7

Implementation to follow...

I must admit, for the common case, 'commify' is a lot simpler and 
shorter to type, so maybe we could put that in too?

A



Reply via email to