to_float support for non String values
This commit is contained in:
1 parent
f3f3c7d31c
commit
e3b45fddfc
2 files changed
+7
-5
No files matched your search
@@ -63,11 +63,7 @@ module Oga
|
||||
value = value.text
|
||||
end
|
||||
|
||||
if value.is_a?(String)
|
||||
value = Float(value) rescue Float::NAN
|
||||
end
|
||||
|
||||
value
|
||||
Float(value) rescue Float::NAN
|
||||
end
|
||||
|
||||
# @return [TrueClass|FalseClass]
|
||||
|
||||
Reference in new issue
Block a user