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:
- Returns0if thetotalis0. 🛑
- Handles edge cases gracefully. ✅ - 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. 📈
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels