Skip to content

fix(shopping): round and format product prices - #418

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Sam-syntax35:fix/shopping-price-rounding
Jul 13, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Sam-syntax35:fix/shopping-price-rounding

Conversation

@Sam-syntax35

Copy link
Copy Markdown
Contributor

Summary

Fixes float precision artifacts shown in Shopping prices.

Backend

  • Round parsed prices to two decimals in parsePrice()
  • Added test covering float32 precision noise

Frontend

  • Format displayed prices using Intl.NumberFormat
  • Display two decimal places with thousands separators

CSV

  • Export prices with at most two decimal places

Notes

  • Existing historical rows can be re-normalized using the existing backfill script.
  • No migration required.

Closes #417

@Sam-syntax35
Sam-syntax35 force-pushed the fix/shopping-price-rounding branch from a7fe398 to 40c9ece Compare July 13, 2026 05:39

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete fix for #417 — rounding applied in all three parsePrice branches with a float32-noise test, Intl formatting covers the tables and (via formatPrice) the card drawer, and the CSV keeps a plain 2-decimal number. CI green. Thanks!

@gkhngyk
gkhngyk merged commit fbcc0d0 into ansvisor:main Jul 13, 2026
3 checks passed
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.

bug(shopping): prices render with float-precision garbage

2 participants