Disregard my last post! That was the regex of the day to replace the one in that commati routine. Works like a charm.
Dan > -----Original Message----- > From: Westgate, Jared [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 15, 2003 9:18 AM > To: Johnson, Reginald (ECCS) > Cc: [EMAIL PROTECTED] > Subject: RE: printing number with commas in it > > > Reggie Wrote: > > > > I am trying to print a number with commas in it. I cannot > > find the correct syntax to do this with printf. > > I considered using the substr function but this depends on > > mealways knowing the size of the number. > > Can you help me with this? > > I like to use the method listed in the perldocs. Try this: > > perldoc -q "output my numbers with commas" > > It lists a really cool solution, although I'm sure there are > plenty of others :) It credits Benjamin Goldberg with this: > > s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; > > Hope this will work for you, > > Jared > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]