mmorga-money 2.1.5 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/money/money.rb CHANGED
@@ -226,8 +226,10 @@ class Money
226
226
  end
227
227
 
228
228
  # Commify ("10000" => "10,000")
229
- formatted.gsub!(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2')
230
-
229
+ unless rules[:no_commas]
230
+ formatted.gsub!(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2')
231
+ end
232
+
231
233
  if rules[:with_currency]
232
234
  formatted << " "
233
235
  formatted << '<span class="currency">' if rules[:html]
data/money.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "money"
3
- s.version = "2.1.5"
3
+ s.version = "2.1.6"
4
4
  s.summary = "Money and currency exchange support library"
5
5
  s.email = ["hongli@phusion.nl", "mmorga@rackspace.com"]
6
6
  s.homepage = "http://money.rubyforge.org/"
data/test/money_spec.rb CHANGED
@@ -202,6 +202,10 @@ describe Money do
202
202
  Money.us_dollar(1_000_000_000_12).format.should == "$1,000,000,000.12"
203
203
  Money.us_dollar(1_000_000_000_12).format(:no_cents => true).should == "$1,000,000,000"
204
204
  end
205
+
206
+ it "should not insert commas into the result if the :no_commas included" do
207
+ Money.us_dollar(1_000_000_000_12).format(:no_commas).should == "$1000000000.12"
208
+ end
205
209
  end
206
210
  end
207
211
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmorga-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke