summaryrefslogtreecommitdiff
path: root/lib/rexml/functions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r--lib/rexml/functions.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index b0029660fa..452426703c 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -154,12 +154,16 @@ module REXML
case object
when Array
string(object[0])
- when Numeric
- integer = object.to_i
- if object == integer
- "%d" % integer
+ when Float
+ if object.nan?
+ "NaN"
else
- object.to_s
+ integer = object.to_i
+ if object == integer
+ "%d" % integer
+ else
+ object.to_s
+ end
end
when nil
""