Function formatPrice

  • Formats a given number into a localized string representation in Persian (fa-IR) format. Optionally appends a currency label.

    Parameters

    • number: number

      The number to be formatted.

    • OptionalwithLabel: boolean = false

      Whether to append the currency label to the formatted number.

    Returns string

    The formatted price string.

    formatPrice(123456); // "۱۲۳٬۴۵۶"
    formatPrice(123456, true); // "۱۲۳٬۴۵۶ تومان"