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