Thousand Seperator

2008-03-14 Thread ewanfisher
I'm trying to find some code that will turn: 100 -> 100 1000 -> 1,000 100 -> 1,000,000 -1000 -> -1,000 I know that can be done using a regular expression. In Perl I would do something like: sub thousand { $number = reverse $_[0]; $number =~ s/(\d\d\d)(?=\d)(?!d*\.)/$1,/g;

Script Running Time

2008-02-21 Thread ewanfisher
Hello, I am trying to find a way to output how long a script took to run. Obviously the print would go at the end of the script, so it would be the time up till that point. I also run a PostgreSQL query inside the script and would like to separately show how long the query took to run. Is this e