wonder 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 376dd96b0c679d9bfdbe93b749fbae152ce57aa4
4
- data.tar.gz: 2ba2fd9ea1878f93d55e74c6628739290f1052d1
3
+ metadata.gz: c12db2f33ef50749ca1f9113ab1929fb5ee32875
4
+ data.tar.gz: a22d51d4d5e99bb06c81f090903eca8308c5d320
5
5
  SHA512:
6
- metadata.gz: 2af1e6778f8def7601e1f27921cd59a5c6842f3ab4b5d60eeeaa8670798a1c9a61bf853d57e7c5ce49a794c5959b2cb4e991b3f17bd36f0c7f91b8b3ee042772
7
- data.tar.gz: 27fd8b21a675edff1663252236973ad20c4b94184e482986e768824bdbd63818f47443394cd44c87d45f780cd914c526e52278f95cb57671760a7ce7630fd176
6
+ metadata.gz: 4182169fd0a4cac3b2ad093a822a84a67b04f15ff34dc43ce250dd45d8bb4b2dc6c6181c193ba254fc08569a36a6bca957763f19a7c6bad803b129577590edba
7
+ data.tar.gz: ef3d0ad7c232dffa10586b073e56273fb4125c320eaf268fc36b58c5b47d9efae54717a10f0e7857d2c49c09420a81f67d6251152dcacf2829187712c9a17d0f
data/README.md CHANGED
@@ -40,7 +40,7 @@ puts 12345.67.commas #12,345.67
40
40
 
41
41
  ## Contributing
42
42
 
43
- 1. Fork it ( https://github.com/[my-github-username]/wonder/fork )
43
+ 1. Fork it ( https://github.com/sdr/wonder/fork )
44
44
  2. Create your feature branch (`git checkout -b my-new-feature`)
45
45
  3. Commit your changes (`git commit -am 'Add some feature'`)
46
46
  4. Push to the branch (`git push origin my-new-feature`)
@@ -54,6 +54,14 @@ end
54
54
 
55
55
  # format an integer
56
56
 
57
+ BigDecimal.class_eval do
58
+ def commas
59
+ str = sprintf("%0.2f",self).to_s.reverse
60
+ str.gsub!(/([0-9]{3})/,"\\1,")
61
+ str.gsub(/,$/,"").reverse
62
+ end
63
+ end
64
+
57
65
  Integer.class_eval do
58
66
  def commas
59
67
  str = sprintf("%0.2f",self).to_s.reverse
@@ -1,3 +1,3 @@
1
1
  module Wonder
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wonder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sdr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-23 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler