From c7378cacc55c921877a511414183c884ba1ac376 Mon Sep 17 00:00:00 2001 From: Steve Nunez Date: Sun, 18 May 2025 11:53:23 +0800 Subject: [PATCH] Add task for the demo --- issue-53.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 issue-53.md diff --git a/issue-53.md b/issue-53.md new file mode 100644 index 00000000..88709a5e --- /dev/null +++ b/issue-53.md @@ -0,0 +1,32 @@ +# โœจ Add Percentage Calculation Utility + +## ๐Ÿ“„ Description +We need a utility function to calculate percentages within the PowerBI JavaScript library. This utility will streamline scenarios where percentage calculations are needed, such as: +- ๐Ÿ“Š Rendering percentage-based visualizations. +- โณ Displaying progress indicators. +- ๐Ÿ“ˆ Calculating relative metrics for data processing. + +## ๐Ÿ› ๏ธ Requirements +- Add a function to calculate percentages based on a `part` and a `total`. +- Ensure the function: + - Returns `0` if the `total` is `0`. ๐Ÿ›‘ + - Handles edge cases gracefully. โœ… +- Place the function in the appropriate utilities or helper file. ๐Ÿ“‚ + +## โœ… Acceptance Criteria +- ๐Ÿ–‹๏ธ A fully implemented `calculatePercentage` utility function. +- ๐Ÿงช Comprehensive unit tests validating its functionality written in Jest. +- ๐Ÿ“ Clear and concise documentation accompanying the function. + +## ๐Ÿ’ก Rationale +This utility will: +- ๐Ÿงน Improve code reusability and readability. +- ๐Ÿš€ Reduce redundancy in calculating percentages across the codebase. +- ๐Ÿ›ก๏ธ Ensure consistent implementation of percentage logic. + +## ๐Ÿ”ฅ Priority +**Medium** + +## ๐Ÿ” Additional Notes +- Ensure the function adheres to existing code style and patterns within the repository. ๐ŸŽจ +- Maintain clarity and simplicity to support future enhancements. ๐Ÿ“ˆ