Skip to content

Numeric export review guide

Decimal precision and units in numeric exports

Keep the mathematical value, decimal scale, unit, and rounding rule visible when a numeric export crosses systems. The worksheet below separates wire representation from meaning before a parser rounds or relabels a value.

A safe numeric export contract names what a number means, how it is represented, how much precision it carries, which unit applies, and when rounding is allowed. JSON permits numbers, but interoperable consumers may use binary floating point, so a value that looks exact in one tool can change in another. Use a JSON string when exact decimal or long-integer text must survive unchanged, and validate the chosen representation separately from the unit policy. This is a review method, not a guarantee that a downstream calculation is correct.

Updated

On this page

Name the number before choosing a type

Start with the semantic role, not the column name. A count is usually an integer, a measured quantity may need a unit and a decimal scale, a ratio may need a declared denominator, and an identifier is often text even when it contains only digits. “Numeric” is not enough to decide whether a consumer may round, add, compare, or display a value.

Write the contract in one sentence: “This field is a measured quantity in the named unit, represented at the stated scale, with rounding applied only at the stated boundary.” If the sentence cannot say where rounding happens, the export does not yet have a precision policy. The source dates shown in this guide identify documentation checks on 22 October 2026, not original publication dates.

Name the number before choosing a type (table)
Semantic roleWire choice to considerReview question
CountJSON integer with an explicit rangeCan every consumer represent the largest value exactly?
Measured decimalJSON number or decimal string by contractWhere is scale and rounding documented?
Ratio or rateNumber plus numerator, denominator, or unit noteCould two readers assume different denominators?
IdentifierJSON string, preserving lexical formWould numeric parsing remove meaningful characters?
Sentinel or statusEnum string or explicit nullable fieldIs a special number hiding a state?

Record wire value and intended value together

A review packet should keep the source lexeme, parsed value, scale, unit, and operation visible. The lexeme is the text that crossed the wire. The parsed value is what the reviewing tool understood. Keeping both makes it possible to spot a parser that turned a trailing zero into a shorter display scale or rounded a value before validation.

Record wire value and intended value together (table)
Field in the worksheetExample synthetic entryWhy it matters
metric_kindmeasured_decimalSeparates measurement from count or identifier
raw_lexeme1.250Preserves what the producer emitted
normalized_value1.250 as a decimalShows the arithmetic value without losing scale
scale3States the intended decimal places
unitmeterPrevents a bare number from being misread
rounding_stagenot_before_validationMakes a lossy operation reviewable
statuspass, review, or unknownKeeps incomplete evidence out of a pass claim

The table is a worksheet, not a universal schema. Choose names that match the receiving contract and retain the original field names in a mapping. Do not replace an unknown unit with a guess. An unresolved unit is a review finding, even when the number itself parses cleanly.

Choose a representation that survives the boundary

RFC 8259 allows JSON numbers, but its interoperability guidance describes a practical boundary around IEEE 754 binary64. RFC 8785 makes the consequence concrete for canonicalization: JCS serializes numbers under that model and points to strings for higher precision or longer integer values. If exact decimal text is part of the meaning, a string with a documented decimal grammar can be safer than relying on every consumer to share a decimal implementation.

Choose a representation that survives the boundary code example, Python
import json
from decimal import Decimal

payload = '{"reading":"1.250", "count": 17}'
row = json.loads(payload, parse_float=Decimal, parse_int=Decimal)

reading = row["reading"]
count = row["count"]
assert isinstance(reading, str)
assert Decimal(reading) == Decimal("1.250")
assert count == Decimal("17")

This small fixture demonstrates a review technique, not a drop-in parser policy. The receiving contract still needs a scale, range, exponent policy, and error behavior. Test a value with trailing zeros, a boundary integer, a negative value if allowed, and a value that should be rejected. Check the serialized output again after any transformation.

The JSON Schema, (opens in a new tab) validation vocabulary can express numeric constraints such as minimum, maximum, multipleOf, and integer type. Those constraints do not supply a unit or decide whether a decimal should be a string. Keep the mathematical contract and the JSON Schema contract adjacent in the packet.

Declare units and prefixes without shortcuts

A number without a unit is only useful when the field contract makes the dimension obvious. Prefer a unit field, a documented field-name convention, or a typed schema that cannot be separated from the value. Record whether the export contains a base unit, a derived unit, or an agreed non-SI unit, and state any conversion boundary explicitly.

NIST lists SI base units and derived units such as area, volume, and velocity. Its SI prefix guidance distinguishes defined prefixes from local shorthand. An unexplained or domain-specific shorthand may not use a defined SI multiplier, so do not turn an abbreviation into a unit by intuition. Ask the producer for the unit vocabulary and conversion rule, then test the conversion with a synthetic value.

Declare units and prefixes without shortcuts (table)
CheckEvidence to requestFinding if absent
DimensionQuantity kind and unit nameMeaning is ambiguous
PrefixDefined prefix and multiplierScale may be wrong
ConversionFormula and directionConsumers may invert the value
DisplayAllowed decimal placesPresentation may be mistaken for precision
AuditOriginal lexeme and transformed valueRounding cannot be traced

Validate before and after rounding

Run validation on the representation that the contract names, then repeat the checks after any permitted normalization. A value can satisfy a range before rounding and fall outside it after rounding, or it can appear to satisfy a scale check only because a consumer formatted it for display. Record which version was tested and why the transformation is allowed.

Validate before and after rounding (table)
Synthetic caseExpected review action
1.250 where scale is threeKeep the lexeme and confirm trailing zero policy
1.25 where scale is threeReview whether padding is required or only display-level
A long integer near the consumer limitTest exact round trip or use a string contract
A number with an unknown unitStop semantic interpretation and request the unit
A rounded value at a rule boundaryCompare pre-round and post-round validation results

A useful finding says “the wire value is parseable but the unit and rounding boundary are undocumented.” It does not say “the dataset is accurate.” Keep precision, units, completeness, and business meaning as separate findings. That separation makes a follow-up request small and testable.

Take a qualified next step

If the owner can describe the collection and its handling authority, the next step may be the appraisal route. That route is a request for review, not automatic acceptance, a quote, a buyer match, a legal opinion, or a license. Keep sensitive values out of a first-pass numeric worksheet and share only the approved evidence needed to answer the named question.

Takeaways

  • Classify the field before choosing JSON number or string.
  • Keep the raw lexeme, parsed value, scale, unit, and rounding stage visible.
  • Use a documented exact representation when consumer precision is uncertain.
  • Treat unit and prefix rules as part of the schema, not display decoration.
  • Report parseability, precision, units, and business meaning as separate findings.

Sources

  1. Internet Engineering Task Force: The JavaScript Object Notation (JSON) Data Interchange Format (opens in a new tab)
  2. Internet Engineering Task Force: JSON Canonicalization Scheme (JCS) (opens in a new tab)
  3. National Institute of Standards and Technology: SI Units (opens in a new tab)
  4. National Institute of Standards and Technology: NIST Guide to the SI: Chapter 4, Two Classes of SI Units and SI Prefixes (opens in a new tab)
  5. JSON Schema: JSON Schema Validation: Draft 2020-12 (opens in a new tab)

Use the appraisal route only after the numeric contract is clear.

Preparation does not promise acceptance, a buyer, a quote, or an offer.