summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/is_numeric.rb
diff options
context:
space:
mode:
authorHenrik Lindberg <henrik.lindberg@cloudsmith.com>2014-01-24 00:22:09 +0100
committerHenrik Lindberg <henrik.lindberg@cloudsmith.com>2014-01-24 00:22:09 +0100
commit2c8450d830453e452b819bfb05678768336c3031 (patch)
tree8b7208929b29fd483f912d74b0cdd6e3ccc08654 /lib/puppet/parser/functions/is_numeric.rb
parent264dc9bbdee8f04b78f8193d62d17b2ba096d671 (diff)
(PUP-1195) Rephrase documentation for is_integer and is_numeric
The documentation contained references to future decisions about functionality. Text rephrased for clarity.
Diffstat (limited to 'lib/puppet/parser/functions/is_numeric.rb')
-rw-r--r--lib/puppet/parser/functions/is_numeric.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/puppet/parser/functions/is_numeric.rb b/lib/puppet/parser/functions/is_numeric.rb
index f2417f3..e7e1d2a 100644
--- a/lib/puppet/parser/functions/is_numeric.rb
+++ b/lib/puppet/parser/functions/is_numeric.rb
@@ -4,13 +4,15 @@
module Puppet::Parser::Functions
newfunction(:is_numeric, :type => :rvalue, :doc => <<-EOS
-Returns true if the variable passed to this function is a number.
+Returns true if the given argument is a Numeric (Integer or Float),
+or a String containing either a valid integer in decimal base 10 form, or
+a valid floating point string representation.
-The function recognizes only integer and float but not hex or octal
-numbers (for now) until a decision is made how to handle these types.
+The function recognizes only decimal (base 10) integers and float but not
+integers in hex (base 16) or octal (base 8) form.
-The parameter can be in the native format or given as string representation
-of a number.
+The string representation may start with a '-' (minus). If a decimal '.' is used,
+it must be followed by at least one digit.
Valid examples: