We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8f25818 + d9b787a commit f55d5d5Copy full SHA for f55d5d5
lib/puppet/parser/functions/min.rb
@@ -13,8 +13,11 @@ module Puppet::Parser::Functions
13
# Sometimes we get numbers as numerics and sometimes as strings.
14
# We try to compare them as numbers when possible
15
return args.min do |a, b|
16
- a.to_f <=> b.to_f if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z}
17
- a.to_s <=> b.to_s
+ if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z}
+ a.to_f <=> b.to_f
18
+ else
19
+ a.to_s <=> b.to_s
20
+ end
21
end
22
23
0 commit comments