This website works better with JavaScript.
Home
Explore
Help
Sign In
adrianshort
/
armchairauditor
mirror of
https://github.com/adrianshort/armchairauditor.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
0
Wiki
Activity
Browse Source
Improved commify()
pull/3/head
Adrian Short
14 years ago
parent
860fb4ef34
commit
15886f6859
1 changed files
with
1 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
app.rb
+ 1
- 1
app.rb
View File
@@ -6,7 +6,7 @@ require 'lib/models'
helpers do
def commify(amount)
amount.to_s.
gsub(/(\d)(?=(\d{3})+$)/,'\1,')
amount.to_s.
reverse.gsub(/(\d\d\d)(?=\d)(?!\d*\.)/,'\1,').reverse
end
end
Write
Preview
Loading…
Cancel
Save