Add percentage display to extras in spreadsheet#14
Merged
Conversation
commit 989319906069c1cecf7ed5bd8cee454d87ebcd3f
Author: Sung Cho <sung.w.cho@pm.me>
Date: Sat Oct 18 20:59:51 2025 -0700
download spreadsheet
commit b4b833a9a0e8f04daf2896f131f4ea7398702612
Author: Sung Cho <sung.w.cho@pm.me>
Date: Sat Oct 18 20:53:50 2025 -0700
get spreadsheet with formulas
| for extra in self.extras.items: | ||
| row_data = [extra.name, extra.price] | ||
| percentage = (extra.price / subtotal) * 100 | ||
| if percentage == int(percentage): |
There was a problem hiding this comment.
Bug: Percentage Formatting Fails Due to Precision
The direct floating-point equality check for whole number percentages can fail due to precision issues. This results in percentages that are effectively whole numbers being incorrectly formatted with decimals (e.g., "20.00%") instead of as clean whole numbers (e.g., "20%").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the spreadsheet to display percentages for extra items (tax, tip, service charge, etc.) in the item name.
Changes: