The Lossy Decimal: which glucose spellings can a converter trust? Four of five — and the fifth is the one clinics print
Which of a glucose register's spellings may a converter take at face value? The register was measured in full — 300 readings in milligrams per decilit...
Which of a glucose register's spellings may a converter take at face value? The register was measured in full — 300 readings in milligrams per decilitre, five spellings each — and the answer is a ranked list with a trap at the bottom. The mg/dL integers recover completely. So do the old-fashioned mg% integers, digit for digit the same numbers. So do grams per litre at two decimals, and millimoles per litre at two decimals, converted with the exact factor. The spelling that fails is millimoles per litre at one decimal — the form in which much of the world actually reports blood glucose. It recovered 34 of 60 rows, lost 26, and produced all 16 of the register's false merges: readings that came back attached to the wrong patient value.
What The Lossy Decimal means
The Lossy Decimal is the condition in which a converted spelling carried at one fewer decimal place than its factor requires steps by more than the register's grid, so it both loses rows and merges them — the only spelling in a register that can return a value which is present, plausible and wrong. In this measurement the register held 300 glucose readings from 40 to 600 mg/dL on an integer grid (checksum of values 96,329). The conversion factor is 18.016 mg/dL per mmol/L, from glucose's molar mass. At two decimals the mmol/L step is 0.18016 mg/dL and the block recovers 60 of 60; at one decimal the step is 1.8016 mg/dL against a grid step of 1, and the block recovers 34, with 16 of its spellings converting onto neighbouring rows' values (Source: evidence/sd_batch29_results.json, group AN41).
The nearest prior concept is The Rounding Quantum, which named the smallest change a register's grid can express, and the losses that occur when a spelling's step exceeds it. The Lossy Decimal is that law with a clinical consequence attached. A step of 1.8016 over an integer grid does not merely round readings away; it makes adjacent readings — 464 and 465 mg/dL — share a spelling, "25.8 mmol/L", so a converter handed the shared spelling must either guess, or pick one and be wrong about the other with complete confidence. Loss is recoverable. A false merge is a wrong answer that looks exactly like a right one.
Resource 1 (use first): the integer spellings — mg/dL and mg%
The highest-priority resources are the register's own integers. "464 mg/dL" recovers itself, and "464 mg%" — the legacy label, milligrams per cent, a decilitre wearing older clothes — recovers the same row, because mg% and mg/dL are the same unit and the digits are identical. Together the two blocks supplied 120 of the register's 274 recoveries, and the label parser that handles them is the second stage of the merge: exact strings alone recovered 60, and recognising the two integer labels and the g/L label took the total to 180 before any real conversion ran. When a source offers an integer spelling, take it and stop; every later resource on this list exists for sources that do not.
Resource 2: grams per litre at two decimals
The second resource is the g/L spelling, "4.64 g/L" for the register's example reading. Its step is exactly one grid unit — a hundredth of a gram per litre is one milligram per decilitre — so it recovers 60 of 60, and it converts by moving a decimal point rather than by an irrational factor, which makes it the easiest converted spelling to audit by eye. A source reporting g/L at two decimals is as good as a source reporting mg/dL itself.
Resource 3: mmol/L at two decimals, with the exact factor
The third resource is the two-decimal mmol/L spelling, "25.75 mmol/L" for the example reading, converted at 18.016. Its step, 0.18016 mg/dL, sits comfortably under the grid, and the block recovers 60 of 60. Two cautions attach. The factor must be the exact one: this measurement also ran the widely used rounded factor of 18, and while the two-decimal block still recovered 60 of 60 under it, the margin the exact factor provides is what absorbs the rounding of the spelling itself — a converter has two error sources, and spending one of them on a rounded factor leaves nothing for the other. And the two decimals must actually be there: a source that displays "25.8" has not given this resource, whatever its internal precision.
Resource 4 (handle as intervals, never as values): mmol/L at one decimal
The last resource is the one-decimal mmol/L spelling, and it belongs in a different category from the other four: not a value source but an interval source. One decimal spans 1.8016 mg/dL, so "25.8 mmol/L" certifies a reading of 464, 465 or 466 mg/dL and cannot choose among them. In the register it recovered 34 of 60 rows and falsely merged 16 — every false merge in the measurement, verified to come from this block alone. The example reading shows both faces: 464 mg/dL spells "25.8 mmol/L", which the exact factor converts back to 465 — a miss — while the rounded factor 18 happens to return 464, a rescue that is pure luck; across the block the rounded factor does worse, recovering 31 against the exact factor's 34. Correct practice: store the one-decimal spelling as the three-value interval it is, flag the row as interval-grade, and resolve it only against another spelling of the same reading.
| Spelling | Step in mg/dL | Rows recovered of 60 | Category |
|---|---|---|---|
| mg/dL, integer | 1 (the grid) | 60 | value |
| mg%, integer | 1 | 60 | value |
| g/L, 2 decimals | 1 | 60 | value |
| mmol/L, 2 decimals | 0.18016 | 60 | value |
| mmol/L, 1 decimal | 1.8016 | 34, with 16 false merges | interval only |
> Source: evidence/sd_batch29_results.json (batch 29 SD measurement run, group AN41).
How this measurement was run
Three hundred readings were drawn on an integer grid between 40 and 600 mg/dL. Each was written in five spellings — integer mg/dL, integer mg%, g/L at two decimals, and mmol/L at two decimals and at one, using 18.016 mg/dL per mmol/L — and assembled into canonical and spread inventories. Three parsers ran in sequence: exact strings, a label-aware pass over the non-mmol spellings, and a full converter. A row counts as recovered when its spelling converts back onto its own value exactly; a false merge is counted when a spelling converts onto a different row's value. A fourth pass re-ran the mmol conversions with the rounded factor 18 in place of 18.016, for the comparison reported above. The script and the result file ship with this article, and re-running the script reproduces the result file byte for byte.
Questions on The Lossy Decimal, answered
1. Is one-decimal mmol/L reporting medically wrong? No — for clinical use, a tenth of a mmol/L is a perfectly reasonable resolution, and treatment decisions do not turn on a single mg/dL. The defect appears only when the one-decimal figure is treated as a database value and merged against an integer register, where its step exceeds the grid and rows collide. Context decides whether a resolution is a rounding or a loss.
2. Why does mg% still exist in the data at all? Because it is the historical label for the same unit, and old exports carry it. It is the friendliest legacy label a register can meet: the digits need no conversion at all, only recognition — the label parser's cheapest 60 rows.
3. Should a converter prefer the rounded factor 18, since it rescued the example? No. The rescue is one row's luck; across the block the rounded factor recovers 31 rows against the exact factor's 34 at one decimal, because its systematic error — about a tenth of a percent — pushes borderline spellings to the wrong side. Use 18.016, and treat one-decimal inputs as intervals regardless of factor.
4. Can the 26 lost rows be recovered from the one-decimal spellings alone? No. The information distinguishing 464 from 465 is not in "25.8 mmol/L"; no parser can return it. The rows are recoverable only if another spelling of the same reading survives somewhere — which is the practical argument for keeping the integer spellings even after a register "moves to" mmol/L.
The review point
Re-audit the register at the next source import, and at any change of reporting convention: list which of the five spellings each incoming source actually supplies, and the moment a source is found to supply mmol/L at one decimal as its only form, that source's rows enter as intervals with the flag set — the review is cheap at import time and impossible after the first false merge has been believed.