|
Browse
| Submit A New Snippet
| Create A Package
Versions Of This Snippet::
| Snippet ID |
Download Version |
Date Posted |
Author |
Delete |
 |
Trejkaz
| 511 | 2.2 | 2009-09-20 23:14 | Trejkaz |  |
Changes since last version:: 2.1 was broken for numbers < 1000 so I'm reverting to 2.0 behaviour.
|
| 471 | 2.1 | 2009-05-05 15:32 | Robert Klemme |  |
Changes since last version:: Less replacements |
| 11 | 2.0 | 2003-08-05 18:21 | Tom Copeland |  |
Changes since last version:: Works with more decimal points now. |
| 10 | 1.0 | 2003-08-05 17:10 | Tom Copeland |  | |
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: :2.2
n.to_s.gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2')
You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..
|