---
id: change/bcquality/223
type: change
title: "#223 knowledge(data-modeling): code that calculates a unit price rounds it to the currency's Unit-Amount Rounding Precision"
summary: A knowledge article explains when and how to round unit prices to the currency's Unit-Amount Rounding Precision, covering the gap between what Business Central's standard calculation ensures and what custom code must handle to avoid mismatches in line amounts.
tier: official
language: en
tags:
  - feature
  - main
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-20T08:48:28.015Z"
  flags: []
generated:
  at: "2026-10-29T21:26:59.577Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 4e07e7e7403ac858749c9b45cb9a7240846b99e8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/223
    title: "microsoft/BCQuality#223: knowledge(data-modeling): code that calculates a unit price rounds it to the currency's Unit-Amount Rounding Precision"
    date: "2026-10-19"
    commit: 4e07e7e7403ac858749c9b45cb9a7240846b99e8
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines:
    - guideline/microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision
    - guideline/microsoft/skills/review/al-data-modeling-review
  changes: []
number: 223
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/223
kind: pr
base_branch: main
major: null
merged_at: "2026-10-19T10:48:39Z"
author: MichaelDieringer
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 5
  additions: 131
  deletions: 1
  al: 4
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/skills/review/al-data-modeling-review.md
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - development
  - finance
  - sales
quote: null
joined_against:
  major: null
  commit: null
---

# #223 knowledge(data-modeling): code that calculates a unit price rounds it to the currency's Unit-Amount Rounding Precision

> A knowledge article explains when and how to round unit prices to the currency's Unit-Amount Rounding Precision, covering the gap between what Business Central's standard calculation ensures and what custom code must handle to avoid mismatches in line amounts.

[Pull request](https://github.com/microsoft/BCQuality/pull/223) · merged into `main` on 2026-10-19 by MichaelDieringer · 5 files (+131 -1), 4 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Unit prices computed by custom code must be explicitly rounded to currency's Unit-Amount Rounding Precision, unlike the standard calculation
- Subscribers that handle OnUpdateUnitPriceOnBeforeFindPrice or OnUpdateDirectUnitCostOnBeforeFindPrice skip built-in rounding and must implement it themselves
- Round once at the end after all factors, and prefer post-calculation adjustment over replacing the standard result entirely
- Specific exclusions apply to values copied unchanged from rounded fields or taken from external documents without modification
- Mismatch between stored decimal places and displayed rounded value causes line amount discrepancies visible to external systems like e-invoicing and EDI

## AL objects touched

- `microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.good.al`: added, not in the BC? snapshot yet
- [`microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.md`](../../guidelines/microsoft/knowledge/data-modeling/round-calculated-unit-prices-to-unit-amount-precision.md): added, not in the BC? snapshot yet
- [`microsoft/skills/review/al-data-modeling-review.md`](../../guidelines/microsoft/skills/review/al-data-modeling-review.md): modified, not in the BC? snapshot

## Context

- Systems: development, finance, sales

Source: metadata of a merged pull request in microsoft/BCQuality (bcquality): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
