summaryrefslogtreecommitdiff
path: root/functions/round.pp
diff options
context:
space:
mode:
Diffstat (limited to 'functions/round.pp')
-rw-r--r--functions/round.pp9
1 files changed, 9 insertions, 0 deletions
diff --git a/functions/round.pp b/functions/round.pp
new file mode 100644
index 0000000..6bad92d
--- /dev/null
+++ b/functions/round.pp
@@ -0,0 +1,9 @@
+function stdlib::round(
+ Numeric $input,
+) {
+ if $input >= 0 {
+ Integer( $input + 0.5 )
+ } else {
+ Integer( $input - 0.5 )
+ }
+}