Skip to content

[TASK] πŸ› οΈAdd Percentage Calculation UtilityΒ #1

@SIkebe

Description

@SIkebe

✨ 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. πŸ“ˆ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions