You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
5
+
- 📊 Rendering percentage-based visualizations.
6
+
- ⏳ Displaying progress indicators.
7
+
- 📈 Calculating relative metrics for data processing.
8
+
9
+
## 🛠️ Requirements
10
+
- Add a function to calculate percentages based on a `part` and a `total`.
11
+
- Ensure the function:
12
+
- Returns `0` if the `total` is `0`. 🛑
13
+
- Handles edge cases gracefully. ✅
14
+
- Place the function in the appropriate utilities or helper file. 📂
15
+
16
+
## ✅ Acceptance Criteria
17
+
- 🖋️ A fully implemented `calculatePercentage` utility function.
18
+
- 🧪 Comprehensive unit tests validating its functionality written in Jest.
19
+
- 📝 Clear and concise documentation accompanying the function.
20
+
21
+
## 💡 Rationale
22
+
This utility will:
23
+
- 🧹 Improve code reusability and readability.
24
+
- 🚀 Reduce redundancy in calculating percentages across the codebase.
25
+
- 🛡️ Ensure consistent implementation of percentage logic.
26
+
27
+
## 🔥 Priority
28
+
**Medium**
29
+
30
+
## 🔍 Additional Notes
31
+
- Ensure the function adheres to existing code style and patterns within the repository. 🎨
32
+
- Maintain clarity and simplicity to support future enhancements. 📈
0 commit comments