tc39 / ecma402

Status, process, and documents for ECMA 402
https://tc39.es/ecma402/
Other
534 stars 104 forks source link

Units: Consider adding nutrition/energy units #713

Open julen opened 1 year ago

julen commented 1 year ago

Hi, first of all, thanks for working on all the i18n-related specs — they are truly valuable for developers working on apps facing international users.

I'm opening this request as a signal to show the interest/importance of having nutritional units in the list of units sanctioned for use in ECMAScript. I'm aware this list is intentionally downsized, mainly due to the increased download size incurred in shipping implementations.

The justification for the request is backed up by the global nature of the food industry — it affects every single human being. When it comes to (online) food stores, there are regulations that require nutritional data to be displayed to customers (e.g. EU nutrition declaration, FDA Code of Federal Regulations, Nutrition labeling of food).

All in all, having energy units like energy-foodcalorie, energy-joule, energy-kilocalorie, and energy-kilojoule would help fulfill such requirements natively in JavaScript.

ryzokuken commented 1 year ago

Does CLDR have this data?

julen commented 1 year ago

Does CLDR have this data?

Unless I'm looking at the wrong place, I can find data for energy-foodcalorie, here are some examples:

ryzokuken commented 1 year ago

@julen you aren't. Thanks for your extensive research. We'll start discussing this. In the meantime, any further use-cases or support you can demonstrate would make the case for adding support for these units stronger.

sffc commented 1 year ago

There are many issues for adding more units, including

https://github.com/tc39/ecma402/issues/605 https://github.com/tc39/ecma402/issues/607 https://github.com/tc39/ecma402/issues/739

Please read https://github.com/tc39/proposal-unified-intl-numberformat/issues/39 for why we don't just include all units

I'd like to keep these issues open to gather interest, and once there is a strong enough signal, we can make a follow-up proposal to add the most high-demand units.