Метод roundPublic

public static

Сигнатура метода

public static function roundPublic(mixed $value, ?string $currencyId = null): float

Возвращает: float

Описание

Rounds $value to the public-facing precision of $currencyId (or of the base currency when $currencyId is null/empty). Use this for sums that are about to be displayed/persisted in user-visible places (UI cells, REST payloads, exports), where precision must match the currency's DECIMALS — e.g. 2 for RUB/USD, 0 for JPY/KRW. Replaces hardcoded {@see round()} calls with the magic constant 2.

Параметры

2
Имя Тип По умолчанию Флаги
$value mixed —
—
$currencyId ?string null
—

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/Service/Accounting.php
Расположение метода в файле
Строки 301–304

Исходный код

PHP