Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!philmtl!atha!aunro!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.perl Subject: Currency separators. Summary: A way to put commas between thousands digits. Message-ID: <410@oha.UUCP> Date: 17 Mar 90 19:25:38 GMT Reply-To: tony@oha.UUCP Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada. Lines: 30 Return-Path: The following routine puts commas in numbers, eg: 1234567.12 -> 1,234,567.12 sub commas { while ($_ =~ s/^([^.]*)([\d])([\d]{3})([,.].*)?$/\1\2,\3\4/) {} $_; } sub test { print &commas($_),"\n"; } grep(&test($_), split(/\n/,<