forked from microsoft/PowerBI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
β¨ 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
partand atotal. - Ensure the function:
- Returns
0if thetotalis0. π - Handles edge cases gracefully. β
- Returns
- Place the function in the appropriate utilities or helper file. π
β Acceptance Criteria
- ποΈ A fully implemented
calculatePercentageutility 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. π
Metadata
Metadata
Assignees
Labels
No labels