Skip to content

fix(profile): preserve decimal weight in profile display#305

Open
LarytheLord wants to merge 2 commits intosimonoppowa:developfrom
LarytheLord:fix/profile-display-decimal-weight-244
Open

fix(profile): preserve decimal weight in profile display#305
LarytheLord wants to merge 2 commits intosimonoppowa:developfrom
LarytheLord:fix/profile-display-decimal-weight-244

Conversation

@LarytheLord
Copy link

Summary

Fix profile weight display so decimal weights remain visible instead of always being rounded to whole numbers.

Closes #244

What changed

  • Updated ProfileBloc.getDisplayWeight() to format based on value precision:
    • show no decimal for whole-number weights (for example 80)
    • show one decimal for fractional weights (for example 80.5)
  • Added a small internal formatter that first rounds to one decimal place to avoid float noise, then suppresses trailing .0.

Why

Issue #244 reports that selecting a decimal weight is possible in the weight picker but profile display rounds it away. This change preserves user-selected decimal precision in the profile subtitle.

Validation

I could not run Flutter/Dart tests in this environment because flutter and dart CLIs are not installed here.

@Elxas866
Copy link

Elxas866 commented Mar 3, 2026

Nice work, hope the project will rise again πŸ’€

Btw isn't it better to merge into develop first, instad of main? At least that's what I did - 2 already merged

@LarytheLord
Copy link
Author

Thanks for the suggestion, @Elxas866. Good call on branch flow. I opened this against main because it is currently the default branch, but I can retarget to develop if maintainers prefer that for feature/fix intake.\n\nI also pushed a technical follow-up commit (48abbad) to make this PR more robust:\n- extracted weight display formatting into a dedicated utility\n- added unit tests for whole numbers, fractional values, floating-point noise, and rounding behavior\n\nSo this now has both the user-facing fix and regression coverage.

@LarytheLord LarytheLord changed the base branch from main to develop March 8, 2026 14:42
@LarytheLord
Copy link
Author

Good suggestion on branch flow. I’ve now retargeted this PR to (and aligned the other still-open PRs in this repo to as well).

@LarytheLord
Copy link
Author

Good suggestion on branch flow. I’ve now retargeted this PR to develop (and aligned the other still-open PRs in this repo to develop as well).

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.

Accept decimal value for weight

2 participants