APM: Question: breaking up a numeric variable

Rich Cohen cohen at aus.edsr.eds.com
Thu Sep 26 14:41:12 CDT 2002


Pick up a copy of the Perl Cookbook, by Tom Christiansen and Nathan
Torkington (O'Reilly, 1998).  It is very good.

It has answers to this and about 300 other common questions.  And,
most pleasingly, for most questions the Cookbook includes a discussion
of how the solution is structured, alternative solutions, and relevant
trade-offs.

-- Rich

Goldilox writes:
  Is there a good way to take a numeric variable of undetermined length
  
  $var=3423723482309234098;
  $var2=3325656;
  etc.
  and print it out with a comma appropriately placed at every third character
  slot from the end, i.e.
  
  3,423,723,482,309,234,098
  3,325,656
  etc.
  
  Rhett
  
  _______________________________________________
  Austin mailing list
  Austin at mail.pm.org
  http://mail.pm.org/mailman/listinfo/austin
  



More information about the Austin mailing list