From 55d3ff8bb85cb8483ca2039ceff25b8fba61bede Mon Sep 17 00:00:00 2001 From: Repellent Date: Sat, 4 Apr 2026 09:56:40 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B2=D0=BE=D0=B4=D0=B8?= =?UTF-8?q?=D0=BC=20=D0=B2=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=A4=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=87?= =?UTF-8?q?=D0=B8=D1=81=D0=BB=D0=B0,=20=D0=B2=20=D1=81=D0=BE=D0=BE=D1=82?= =?UTF-8?q?=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B8=20=D1=81=20?= =?UTF-8?q?=D1=82=D1=80=D0=B5=D0=B1=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=D0=BC=D0=B8=20PHP=208+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/func.common.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/functions/func.common.php b/functions/func.common.php index f5e4cf5..339e479 100644 --- a/functions/func.common.php +++ b/functions/func.common.php @@ -197,13 +197,20 @@ function rrmdir($dir, &$result = 0) * @param array $param значение и параметры * @return string отформатированное значение */ - function num_format($param) - { - if (is_array($param)) - return number_format($param['val'], $param['dec'], $param['after'], $param['thousand']); + function num_format($param) + { + if (is_array($param)) { + // Если параметр не передан, берем 0 + $val = (float)($param['val'] ?? 0); + $dec = (int)($param['dec'] ?? 0); // По умолчанию 0 знаков, если не указано иное + $after = (string)($param['after'] ?? '.'); + $thousand = (string)($param['thousand'] ?? ''); // По умолчанию без разделителя тысяч - return ''; - } + return number_format($val, $dec, $after, $thousand); + } + + return ''; + } /**