fix: 非单次容量时滴数四舍五入为整数 #8

Closed
yoyo wants to merge 1 commits from fix/volume-rounding into main
Collaborator

关联 Issue #6。

变更内容

  • VOLUME_DROPS 新增 单次 选项(值为 null,不做缩放)
  • 新增 scaleIngredients() 工具函数:按选定容量等比缩放各成分滴数,非单次时用 Math.round() 取整
  • 卡片预览新增容量切换按钮,显示缩放后的整数滴数及对应成本
  • 编辑器成本合计同步反映已选容量的缩放结果

默认容量改为「单次」,展示配方原始滴数;切换到其他容量后,所有滴数按比例放大并四舍五入为整数。

关联 Issue #6。 ## 变更内容 - `VOLUME_DROPS` 新增 `单次` 选项(值为 `null`,不做缩放) - 新增 `scaleIngredients()` 工具函数:按选定容量等比缩放各成分滴数,非单次时用 `Math.round()` 取整 - **卡片预览**新增容量切换按钮,显示缩放后的整数滴数及对应成本 - **编辑器**成本合计同步反映已选容量的缩放结果 默认容量改为「单次」,展示配方原始滴数;切换到其他容量后,所有滴数按比例放大并四舍五入为整数。
yoyo added 1 commit 2026-04-07 22:04:36 +00:00
- VOLUME_DROPS 新增「单次」选项(值为 null,不缩放)
- 新增 scaleIngredients(),按目标容量等比缩放滴数,非单次时 Math.round 取整
- 卡片预览新增容量选择器,使用 scaledIngredients 展示缩放后的滴数及成本
- 编辑器成本合计同步反映已选容量的缩放结果

Co-Authored-By: YoYo <yoyo@euphon.net>
hera closed this pull request 2026-04-10 20:27:53 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hera/oil-formula-calculator#8