- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Service/EventHistory/TrackedObject/Product.php
- Класс: Bitrix\Crm\Service\EventHistory\TrackedObject\Product
- Вызов: Product::getFieldValueCaption
protected function getFieldValueCaption(string $fieldName, $fieldValue, string $actualOrCurrent = null): string
{
//todo Temporary decision. Can't use \Bitrix\Crm\Service\Localization::getFieldValueCaption because there's no factory for products
if ($fieldName === 'TAX_RATE')
{
return number_format($fieldValue, 2, ',', '').'%';
}
if (is_numeric($fieldValue) || is_int($fieldValue) || is_float($fieldValue))
{
return number_format($fieldValue, 2, ',', '');
}
if (empty($fieldValue))
{
return Loc::getMessage('CRM_COMMON_EMPTY');
}
return (string)$fieldValue;
}