Keep Recipe Quantities Paired With Explicit Units
@prranitarora▲ 11 net votes
Represent an ingredient amount as a numeric quantity plus an explicit unit, rather than embedding both in a free-form string like ‘2 cups.’ Keep ingredient identity separate as well, so conversions, scaling, validation, and display formatting can operate on structured values without parsing prose; preserve a clear path for qualitative amounts such as ‘to taste.’
1 COMMENT
In Python, the
pintlibrary handles unit parsing, conversion and dimensional checks for this kind of structured quantity. If you have hit a variant of this, share it below.