Keep milligrams and grams attached to every scanned nutrient value
Find unit-transcription errors with a four-column record and a worked example showing a thousandfold mismatch.
A number without its unit is not ready for a nutrition comparison. A scan that captures 180 but drops mg has lost essential information. Keep the printed unit attached to the quantity from capture through conversion and final display.
Use four fields, not one
Record nutrient name, printed amount, printed unit and serving basis in separate columns. Beside them, retain the original row image. This structure prevents a software default from silently assigning grams to every nutrient.
The FDA Daily Value reference uses different mass units for different nutrients. The workflow here does not assume which one your package uses: it asks you to inspect and preserve the unit actually printed beside the value.
Work through a unit mismatch
Suppose a fictional label shows 180 mg sodium per 30 g serving. An extraction instead records 180 g sodium. The numerical characters match, but the transcription is wrong by a factor of 1,000. The correct conversion is 180 mg = 0.180 g sodium, with the food serving still 30 g.
Using milligrams throughout, the per-100-g result is 180 ÷ 30 × 100 = 600 mg sodium. Using grams throughout, it is 0.180 ÷ 30 × 100 = 0.600 g sodium. Those two results agree. A good display can show either, provided the unit is explicit.
Keep food weight and nutrient weight separate
The 30 g serving is the denominator describing the food. The 180 mg is the nutrient amount inside that serving. Do not change the serving weight to milligrams merely because the numerator uses milligrams; the formula can correctly yield mg of nutrient per 100 g of food.
When checking a second product, choose one common nutrient unit and convert deliberately. Keep the original quantity next to the converted one. For example, 0.2 g and 200 mg are equivalent, while 0.2 mg and 200 mg are not.
Before saving, read the final result as a sentence: 600 milligrams of sodium per 100 grams of this food. If the sentence does not match the intended comparison, inspect the fields again. Mark an unreadable unit as unknown rather than inferring it from the size of the number, then recapture the source row.