aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/plugins/modifier.number_format.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-11 19:20:46 +0000
committerMario <mario@mariovavti.com>2022-10-11 19:20:46 +0000
commit4070c46d157918a01e2a34820985a64fee4e99f0 (patch)
tree2ee04c8a086bb4e2a7c43a2fa2b947e73edffa38 /vendor/smarty/smarty/libs/plugins/modifier.number_format.php
parenta749db8d0f216491cfefb3849891d93f89b775f7 (diff)
downloadvolse-hubzilla-4070c46d157918a01e2a34820985a64fee4e99f0.tar.gz
volse-hubzilla-4070c46d157918a01e2a34820985a64fee4e99f0.tar.bz2
volse-hubzilla-4070c46d157918a01e2a34820985a64fee4e99f0.zip
composer update smarty
Diffstat (limited to 'vendor/smarty/smarty/libs/plugins/modifier.number_format.php')
-rw-r--r--vendor/smarty/smarty/libs/plugins/modifier.number_format.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/smarty/smarty/libs/plugins/modifier.number_format.php b/vendor/smarty/smarty/libs/plugins/modifier.number_format.php
new file mode 100644
index 000000000..8c612601f
--- /dev/null
+++ b/vendor/smarty/smarty/libs/plugins/modifier.number_format.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty number_format modifier plugin
+ * Type: modifier
+ * Name: number_format
+ * Purpose: Format a number with grouped thousands
+ *
+ * @param float|null $num
+ * @param int $decimals
+ * @param string|null $decimal_separator
+ * @param string|null $thousands_separator
+ *
+ * @return string
+ */
+function smarty_modifier_number_format(?float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ",")
+{
+ // provide $num default to prevent deprecation errors in PHP >=8.1
+ return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator);
+}