Skip to content

Add kJ ↔ kcal toggle to composition table#6

Open
bibeklalkarn wants to merge 1 commit into
ifct2017:mainfrom
bibeklalkarn:main
Open

Add kJ ↔ kcal toggle to composition table#6
bibeklalkarn wants to merge 1 commit into
ifct2017:mainfrom
bibeklalkarn:main

Conversation

@bibeklalkarn

Copy link
Copy Markdown

Added kJ ↔ kcal toggle to composition table

Adds a small inline toggle button next to each energy value (displayed in kJ) in the nutrient composition table. Clicking switches the display to kcal (Food Calories) and back. Conversion uses the standard factor of 4.184 kJ/kcal; the ± error value is converted alongside the main value.

No dependencies added. Post-processes the rendered table rows by matching cells whose text matches NNkJ ± NN, so it handles any row with a kJ unit without hardcoding column names.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant