Commercial billing documents must maintain exact mathematical consistency down to the smallest currency fractional unit. Below is the operational JSON data schema representing an active invoice session within Utiliome:
{
"meta": {
"invoiceNumber": "INV-2026-0891",
"issueDate": "2026-11-07",
"dueDate": "2026-12-07",
"currency": "USD",
"currencySymbol": "$"
},
"issuer": {
"name": "Apex Cloud Architecture LLC",
"address": "100 Montgomery St, Suite 1400",
"city": "San Francisco, CA 94104",
"taxId": "US-EIN-94-3829102"
},
"client": {
"name": "Nexus Global Logistics Inc",
"address": "450 Lexington Ave, 8th Floor",
"city": "New York, NY 10017",
"taxId": "US-EIN-13-8829104"
},
"items": [
{
"description": "Infrastructure Security Audit & Hardening",
"quantity": 40,
"unitRate": 225.00,
"amount": 9000.00
},
{
"description": "Zero-Trust Kubernetes Cluster Configuration",
"quantity": 1,
"unitRate": 4500.00,
"amount": 4500.00
}
],
"financials": {
"subtotal": 13500.00,
"discountPercent": 5.0,
"discountAmount": 675.00,
"taxPercent": 8.5,
"taxAmount": 1090.13,
"total": 13915.13
}
}
To prevent IEEE 754 floating-point rounding inaccuracies (such as 0.1 + 0.2 === 0.30000000000000004), calculations are processed in integer minor currency units (cents):
const subtotalCents = items.reduce((sum, item) => {
return sum + Math.round(item.quantity * item.unitRate * 100);
}, 0);
const discountCents = Math.round(subtotalCents * (discountPercent / 100));
const taxableCents = subtotalCents - discountCents;
const taxCents = Math.round(taxableCents * (taxPercent / 100));
const totalCents = taxableCents + taxCents;