lib/nanook/util.rb in nanook-1.0.2 vs lib/nanook/util.rb in nanook-2.0.0
- old
+ new
@@ -8,14 +8,14 @@
def self.NANO_to_raw(nano)
(BigDecimal.new(nano.to_s) * STEP).to_i
end
def self.raw_to_NANO(raw)
- raw.to_f / STEP
+ (raw.to_f / STEP).to_f
end
def self.coerce_empty_string_to_type(response, type)
- if response == ""
+ if response == "" || response.nil?
return type.new
end
response
end