ruby-units 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +1 -0
- data/lib/ruby_units/ruby-units.rb +1 -1
- data/lib/ruby_units/string.rb +4 -4
- data/test/test_ruby-units.rb +1 -0
- metadata +1 -1
data/CHANGELOG.txt
CHANGED
data/lib/ruby_units/string.rb
CHANGED
@@ -9,10 +9,10 @@ class String
|
|
9
9
|
|
10
10
|
# format unit output using formating codes '%0.2f' % '1 mm'.unit => '1.00 mm'
|
11
11
|
def %(*args)
|
12
|
-
case
|
13
|
-
when Unit: args[0].to_s(self)
|
14
|
-
when (
|
15
|
-
when Complex: args[0].to_s
|
12
|
+
case
|
13
|
+
when Unit === args[0]: args[0].to_s(self)
|
14
|
+
when (!defined?(Uncertain).nil? && (Uncertain === args[0])): args[0].to_s(self)
|
15
|
+
when Complex === args[0]: args[0].to_s
|
16
16
|
else
|
17
17
|
unit_format(*args)
|
18
18
|
end
|
data/test/test_ruby-units.rb
CHANGED
metadata
CHANGED