spook_and_puff_money 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/spook_and_puff/money.rb +5 -5
- metadata +2 -2
data/lib/spook_and_puff/money.rb
CHANGED
@@ -199,11 +199,11 @@ module SpookAndPuff
|
|
199
199
|
# @option opts [true, false] :prefix
|
200
200
|
# @return String
|
201
201
|
def to_s(opts = {})
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
202
|
+
rounded = @raw.round(2)
|
203
|
+
prefix = opts[:prefix] == false ? '' : '$'
|
204
|
+
format = (opts[:drop_cents] and rounded == @raw.round) ? "%i" : "%.2f"
|
205
|
+
|
206
|
+
"#{prefix}#{format}" % rounded
|
207
207
|
end
|
208
208
|
|
209
209
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spook_and_puff_money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-10-
|
13
|
+
date: 2013-10-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|