You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The European Commission provides some rounding rules that I believe could be implemented as a plugin: https://food.ec.europa.eu/document/download/3eb7952a-43b8-4c6a-8091-349ea707a9a7_en?filename=labelling_nutrition-vitamins_minerals-guidance_tolerances_1212_en.pdf#page=15
However: that's outside the scope of this pull request. I'll note also that it requires knowledge of the measurement units referenced in some cases, in order to select the relevant logic rules to apply.
Because I'd prefer to figure out a way to harmonise the output values of the nutrients field, I think it makes sense for me to file a feature request for that (and perhaps to try implementing it in the nearish future).
This turns out to be non-trivial to implement, partly because the values in the nutrients result are not simply decimal numbers, but are quantities represented as string (str) values that contain unit names -- and potentially those units may be qualified by scale (g vs mg vs kg).
This could be a candidate for a non-core plugin, either within this repository but disabled by default, or in an entirely separate source code repository. It would be nice to demonstrate that additional plugins can be written without requiring that they're part of the core / enabled by default, and with their own separate test coverage.
However: that's outside the scope of this pull request. I'll note also that it requires knowledge of the measurement units referenced in some cases, in order to select the relevant logic rules to apply.
Because I'd prefer to figure out a way to harmonise the output values of the
nutrients
field, I think it makes sense for me to file a feature request for that (and perhaps to try implementing it in the nearish future).Originally posted by @jayaddison in #1237 (comment)
The text was updated successfully, but these errors were encountered: