4 module Puppet::Parser::Functions
5 newfunction(:round, :type => :rvalue, :doc => <<-DOC
6 Rounds a number to the nearest integer
18 Note: from Puppet 6.0.0, the compatible function with the same name in Puppet core
19 will be used instead of this function.
23 raise Puppet::ParseError, "round(): Wrong number of arguments given #{args.size} for 1" if args.size != 1
24 raise Puppet::ParseError, "round(): Expected a Numeric, got #{args[0].class}" unless args[0].is_a? Numeric