Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Feature Request: Add Configurable Precision Display for Nutritional Values

Đang mở
#1,108 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

The reporter already sketched a implementation (NutritionPrecisionContext, a precision parameter on numberGramLocale, a PrecisionToggleButton) touching the nutrition tables, but the placement (page header vs. user preferences) is an open question with no maintainer decision after ~13 months and zero comments. Start by locating the nutritional value, logged-vs-planned and ingredient detail tables and the numberGramLocale helper, then check open pull requests before doing anything. Done means a maintainer has agreed on where the toggle lives and the display change is covered by tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description:
Hello Wger team;
I've been using wger and noticed that the rounding behavior in nutritional value tables can sometimes lead to confusing calculations. When values are displayed as whole numbers but the underlying calculations use decimal precision, the totals don't always add up correctly, which can be a bit confusing.
Image

Proposed Solution
I've implemented a feature that allows users to toggle between whole number display (current behaviour) and one decimal place display for nutritional values. This gives users more control over how they want to view their nutritional data.

Implementation Details
Here's what I've added:

  1. Created NutritionPrecisionContext to manage precision state across all nutrition components

  2. Extended numberGramLocale function to accept a precision parameter

  3. Added PrecisionToggleButton component with clear visual indicators

This affects all nutrition-related tables including the main nutritional values table, logged vs planned comparison table, and ingredient detail tables.

here is how it looks like
https://youtu.be/41xVraHh9LA

Questions for Discussion
I'm honestly not sure if this precision issue bothers other users or if it's just something I noticed. I built this feature to explore the problem and see if it would be helpful, but I'd love to hear your thoughts on whether this is something users actually need.

Currently I've placed toggle buttons in the page headers, but I'm curious about other options such as move it to user preferences as a permanent setting or try a completely different UI approach.

Any suggestions for improvement? I'm open to feedback on the implementation approach or UI design.

Ngôn ngữ chính
TypeScript
Star
37
Fork
94
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wger-project/react

Tất cả issue của wger-project/react

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.