UnitDP
Controls the number of decimal places returned for unit prices in query results. This setting affects the precision of unit price values retrieved from the Xero API.
Data Type
string
Default Value
"2"
Remarks
By default, the Xero API returns unit prices rounded to 2 decimal places. You can increase the precision by setting this property to 4, which returns unit prices with up to 4 decimal places as stored in Xero.
Examples:
UnitDP = "2" // Unit price is 25.00 UnitDP = "4" // Unit price is 25.0048Set this to 4 if your use case requires high precision in pricing, such as inventory valuation or billing scenarios with fractional pricing.
Note: This property only affects unit prices. Other computed values such as line-item amounts and totals continue to be rounded to 2 decimal places as per Xero’s standard behavior and accounting rules.