Setting up price rounding rules in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Configuring Price Rounding Rules in 1C-Bitrix

Price rounding in 1C-Bitrix is the point where a mathematically correct result is perceived as an artifact. A 7% discount on a product priced at 349 gives 324.57. Displaying such a price in a storefront is undesirable. Bitrix addresses this through rounding rules in the catalog module.

Where Rounding Is Configured

"Settings → Product Settings → Catalog → Price Rounding". In earlier versions — in the settings of the bitrix:catalog.element and bitrix:catalog.section components, with separate parameters PRICE_VAT_INCLUDE and individual rounding settings.

Global rounding rules — CCatalogProduct::getRoundRules() reads from b_catalog_rounding_rule.

Types of Rounding Rules

Rule Description Example
Mathematical Standard: 0.5 → round up 324.57 → 325
Always down floor() 324.57 → 324
Always up ceil() 324.01 → 325
To required precision Precision set in settings 324.57 → 320 or 324.6

Programmatic Rule Configuration

// Adding a rounding rule
\Bitrix\Catalog\RoundingTable::add([
    'CATALOG_GROUP_ID' => $priceTypeId, // 0 = all price types
    'PRICE_FROM'       => 0,
    'PRICE_TO'         => 999.99,
    'ROUND_TYPE'       => \Bitrix\Catalog\RoundingTable::ROUND_MATH,
    'ROUND_PRECISION'  => 0, // round to whole numbers
]);

// For prices from 1000 — a different rule
\Bitrix\Catalog\RoundingTable::add([
    'CATALOG_GROUP_ID' => $priceTypeId,
    'PRICE_FROM'       => 1000,
    'PRICE_TO'         => null,
    'ROUND_TYPE'       => \Bitrix\Catalog\RoundingTable::ROUND_MATH,
    'ROUND_PRECISION'  => -1, // round to tens
]);

ROUND_PRECISION — number of decimal places (negative values round to tens, hundreds).

Rounding in Cart and Storefront

Rounding rules are applied when computing the final price via CCatalogProduct::GetOptimalPrice(). In the cart component — when recalculating the line total. Important: VAT is added after rounding the base price, not before.

Psychological Pricing

For prices ending in ".99", rounding rules are not suitable — this is a marketing task solved by a post-processing handler. For example, an OnSaleOrderBeforeSaved event handler or a custom price recalculation method.

Timeline

Configuring rounding rules for all price types — 1–3 hours. Custom logic (psychological pricing, different rules for categories) — 4–8 hours.