•

AI Number Extraction: Resolve Decimal Separators

A grayscale hand positions a divider above steel spheres with two alternative grouping brackets in a painted hillside landscape.
What’s in this article?

    Keep decimal and grouping conventions from changing the value of an extracted number. Use source evidence, a field-level parsing contract and explicit holds before a business system acts.

    A supplier quote lists a rate as 1,234. One interpretation is one thousand two hundred thirty-four; another is one point two three four. Both can be well-formed numbers. An AI response containing valid JSON does not establish which value the supplier intended.

    Reliable AI number extraction separates reading the characters, resolving their numeric convention and authorizing their use. This guide proposes a production design for document-driven operations. It is not a tested customer deployment or a universal parser specification. Start with one field and document family, rather than a rule that removes punctuation from every number.

    Resolve the convention before normalizing the value

    A decimal separator divides the whole and fractional parts. A grouping separator organizes digits without changing their place value. The same visible punctuation can serve different roles under different conventions.

    Unicode CLDR’s number specification distinguishes decimal and grouping symbols, numbering systems and grouping patterns. Those resources describe conventions; they cannot establish which convention a particular submitted field uses.

    A request written in English can contain a supplier’s decimal-comma quotation. A company address, server locale or currency code alone should not choose the interpretation. Define what evidence makes a convention applicable to that field: for example, an explicit document legend, an agreed submission specification or a reviewed document-family configuration.

    A successful parse is not evidence of intent

    Babel’s decimal parsing API accepts a locale and returns a decimal value; its strict option rejects irregular formatting. That is useful validation after choosing a justified convention. It does not prove that the selected locale matches the source.

    Do not try several locales and accept whichever parser succeeds first. More than one can succeed with different values. Conversely, one surviving parse does not prove intent if OCR dropped a separator. Keep lexical fidelity, convention evidence and business plausibility as separate checks.

    Formatting, units and currency are different decisions

    Reading 1.234,56 as 1234.56 changes its representation, not its currency or unit. Converting dollars to euros or cases to individual items requires additional evidence and rules. Use the quantity and unit validation process after numeric interpretation where relevant; do not let normalization perform an undocumented conversion.

    Give AI, rules, people and systems separate jobs

    • AI locates evidence: return the original numeric text, field meaning, nearby label and source location. It may identify a convention statement but cannot approve its own guess.
    • Rules resolve and validate: select only an authorized field policy, parse under that policy, enforce grouping and destination constraints, and retain failures.
    • People resolve ambiguity: the document owner clarifies intended notation; the process owner approves interpretation policy and consequential exceptions.
    • Systems preserve and execute: retain the source revision, accepted interpretation and authorized action receipt. A parsed value is not permission to update a live record.

    Supply the model only with authorized source material and necessary context. Require separate fields for original text and any proposed value. If the model has already rewritten the punctuation and discarded the original, do not treat that rewritten field as independent source evidence.

    Microsoft AI Builder’s number-convention documentation illustrates this separation: it documents one convention per field across a model’s collections, and exposes original text separately from converted values. An impossible conversion leaves the converted result empty. Those are product-specific behaviors, not a guarantee about your reader or other extractors.

    Write a field-level numeric acceptance contract

    Use this reusable record at the extraction-to-normalization boundary. It extends a broader AI data validation workflow with evidence specific to numeric notation. These are recommended application fields, not a Workhint or parser API schema.

    Minimum evidence for accepting a normalized number
    RecordRequired informationAcceptance question
    SourceSubmission and artifact revision/hash; page, region or cell; original numeric text and field labelCan a reviewer compare the proposed value with this exact source?
    Field meaningRate, total, count or identifier; separate unit/currency evidence where requiredIs this actually a numeric magnitude, rather than a reference whose leading zeros matter?
    Convention authorityApplicable specification or reviewed clarification; field/document scope; decimal, grouping and numbering-system rulesWhy does this convention apply here, and is any evidence conflicting?
    ResolverParser, version, locale-data version where available, strictness and permitted preprocessingCan the same source be interpreted reproducibly?
    DestinationRepresentation, precision, scale, sign/range rules and explicit rounding policyCan the receiving field preserve the accepted value without a silent change?
    DispositionAccepted value or hold reason; reviewer/owner; accepted revision; separate execution referenceIs uncertainty still visible, and can only the accepted revision advance?

    Choose policy precedence explicitly. If a reviewed document-family rule conflicts with a field legend, hold the affected field for resolution rather than silently favoring one. A manual clarification must identify the source, field and applicable revision; “this supplier usually uses commas” is too vague.

    Define preprocessing narrowly. Preserve the original characters before replacing an allowed grouping space or mapping permitted digits. Unsupported symbols, irregular grouping and mixed conventions need an explicit disposition. A global “remove all commas” step can multiply a decimal-comma value by a thousand.

    Use a disposition matrix, not a punctuation shortcut

    The following cases are illustrative policy examples. Acceptance always depends on verified source fidelity, applicable convention evidence and destination constraints.

    Numeric interpretation decisions before downstream use
    Observed text and contextProposed dispositionWhat must not happen
    1,234; convention unknownHold. Preserve both plausible magnitudes, 1234 and 1.234, as unresolved alternatives.Choose by server locale or whichever magnitude fits an approval limit.
    1,234.56; applicable decimal-point, comma-grouping specificationParse to 1234.56 if grouping and other field checks pass.Delete punctuation before determining its role.
    1.234,56; applicable decimal-comma, point-grouping specificationParse to the same magnitude, 1234.56, under that separate policy.Apply the previous row’s convention to the whole inbox.
    12,34; field requires strict three-digit comma grouping and a decimal pointReject that representation or seek clarification under the field policy.Repair it to 1234 or reinterpret it as 12.34 without authority.
    1,234; decimal-comma interpretation accepted, destination allows two fractional digitsHold unless an explicit rounding policy and required approval permit a changed value.Silently round 1.234 to 1.23 and call it faithful extraction.
    Missing converted output, but original text existsRetain a conversion failure and route it for resolution.Substitute zero or claim the source field was blank.

    Use field relationships as cross-checks, not a way to manufacture authority. A line-total calculation can expose inconsistency. It cannot conclusively determine the locale if several fields were misinterpreted together or the source itself is wrong.

    Work through a quote-rate ambiguity

    Constructed example: a service quote shows 100 units at a rate of 1,234, with a separate total of 123,40. The destination accepts a rate with three fractional digits and a total with two. There is initially no accepted convention specification.

    1. Capture: preserve both numeric spans, the unit/rate labels and the quote revision. AI proposes field mappings without releasing a purchase request.
    2. Hold: the rate has competing magnitudes. The apparent arithmetic fit of a decimal-comma interpretation is supporting context, not final authority.
    3. Clarify: the authorized supplier contact confirms that this quote uses a decimal comma. Retain that clarification linked to this revision and the relevant fields. Resolve any conflicting configuration before acceptance.
    4. Normalize: deterministic rules interpret the rate as 1.234 and the quoted total as 123.40. The illustrative check is 100 × 1.234 = 123.400, numerically equal to 123.40. Separately verify units, currency and any business approval requirements.
    5. Release: record the accepted interpretation revision and obtain the required approval. The execution system writes only the authorized fields and verifies the destination result.

    If a different destination supports only two rate decimals, this example cannot pass unchanged. Do not round merely to make it fit. Obtain an authorized pricing/rounding decision or use a permitted representation that preserves the value. Parsing success must not hide destination loss.

    Test ambiguity and recovery before widening release

    Create reviewed fixtures for each admitted document family. Keep the original source and expected disposition with each fixture. At minimum, include:

    1. Two valid parses: 1,234 with no convention evidence must hold, even if both parsers return values.
    2. Opposite conventions: 1,234.56 and 1.234,56 must normalize equivalently only under their respective justified policies.
    3. Malformed grouping: 12,34 must not pass the strict grouping policy in the matrix.
    4. Grouping-space variation: test the actual space characters supported by your reader and parser; unsupported variants must remain failures, not guessed repairs.
    5. Zero versus missing: a genuine supported zero remains distinct from blank source text and failed conversion.
    6. Precision loss: an accepted three-decimal rate sent to a two-decimal target must trigger the stated policy, not silent truncation.
    7. Conflicting evidence: a field legend and configured convention disagree; the workflow must hold and identify an owner.
    8. Revision race: a late extraction or clarification for an older quote must not overwrite the accepted current revision.

    Measure exact normalized-value accuracy against reviewed truth, false acceptance of ambiguous fields, unnecessary holds and destination-value mismatches separately. State the evaluated document families and denominators. Review effort and hold age are operational measures, not proof of improved extraction accuracy.

    Make holds recoverable without guessing

    A practical state model is Captured → Convention checked → Parsed → Accepted → Released, with separate held, rejected and technical-failure outcomes. Every hold needs a reason, responsible owner, next action and escalation target. A reviewer rejection must not become an automatic prompt retry until a different number appears.

    Retry transient reader outages against the retained source and policy with bounded attempts. Check the existing job before resubmitting after an uncertain timeout. Semantic ambiguity needs evidence, not repeated sampling. If a clarification or source revision changes the interpretation, invalidate affected calculations and approvals and produce a new accepted revision.

    Correlate callbacks with the source, extraction attempt and policy revision. Downstream writes need separate stable action identities and reconciliation of uncertain outcomes before replay. The closure condition is the authorized destination state, not merely a completed extraction task.

    Where Workhint fits

    Workhint’s Workflow Engine describes routing approvals to defined roles and requiring details, files or approval steps before work advances. Those controls are relevant when a numeric exception needs a named reviewer and evidence before the request proceeds.

    The Workflow Automation Software solution describes structured intake, assigned review stages and tracking stages, owners and next actions. That supports defining the operational handoff around a held document.

    These pages do not establish a native numeric-locale resolver, decimal parser or specific extraction connector. Evaluate those components and their evidence contracts separately. Review routing cannot repair a value that was silently changed before it entered the workflow.

    Frequently asked questions

    Can the model infer the locale from the document language?

    It can propose a hypothesis, but language alone does not establish a field’s numeric convention. Use applicable source evidence or an authorized clarification and preserve its scope.

    Does strict parsing eliminate ambiguity?

    No. Strictness can reject malformed input under a chosen convention. Two conventions can still accept the same characters with different magnitudes.

    Should every extracted number become a JSON number?

    Not automatically. Choose the destination contract explicitly, including precision and scale. Preserve the original text and keep identifiers separate from magnitudes; a code with leading zeros is not necessarily a number to normalize.

    Can a matching total authorize the interpretation?

    No. Arithmetic consistency is a useful cross-check, but does not replace convention evidence or the separate business authorization to act.

    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *


    The reCAPTCHA verification period has expired. Please reload the page.