Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
pricemaths.php
1
<?php
2
3
namespace
Bitrix\Sale
;
4
5
use
Bitrix\Main
;
6
7
class
PriceMaths
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
}
Bitrix\Sale\PriceMaths
Definition
pricemaths.php:8
Bitrix\Sale\PriceMaths\roundByFormatCurrency
static roundByFormatCurrency($price, $currency)
Definition
pricemaths.php:38
Bitrix\Sale\PriceMaths\roundPrecision
static roundPrecision($value)
Definition
pricemaths.php:16
Bitrix\Main\Config
Definition
configuration.php:2
Bitrix\Main
Bitrix\Sale
modules
sale
lib
pricemaths.php
Создано системой
1.10.0