lib/populate_me/ext.rb in populate-me-0.0.15 vs lib/populate_me/ext.rb in populate-me-0.0.16
- old
+ new
@@ -2,10 +2,10 @@
# Extends standard classes
Integer.class_eval do
def to_price_string
- ("%.2f" % (self/100.0)).sub(/\.00/, '')
+ ("%.2f" % (self/100.0)).sub(/\.00/, '').reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
end
end
String.class_eval do
def to_price_integer