Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
pricemaths.php
1<?php
2
3namespace Bitrix\Sale;
4
6
8{
9 private static ?int $valuePrecision = null;
10
16 public static function roundPrecision($value)
17 {
18 if (!isset(self::$valuePrecision))
19 {
20 self::$valuePrecision = (int)Main\Config\Option::get('sale', 'value_precision');
21 if (self::$valuePrecision < 0)
22 {
23 self::$valuePrecision = 2;
24 }
25 }
26
27 return round((float)$value, self::$valuePrecision);
28 }
29
38 public static function roundByFormatCurrency($price, $currency)
39 {
40 return (float)SaleFormatCurrency($price, $currency, false, true);
41 }
42}
static roundByFormatCurrency($price, $currency)
static roundPrecision($value)