Function multiply

  • Multiplies numbers (can be in Bangla or English digits). Accepts either two arguments (a, b) or an array of numbers.

    Parameters

    • a: string | number | (string | number)[]

      First number (Bangla or English digits) or an array of numbers.

    • Optionalb: string | number

      Second number (Bangla or English digits). Optional if a is an array.

    • en: boolean = false

      If true, returns the result in English digits. Default is false (returns Bangla digits).

    Returns string

    The product of the numbers.

    multiply("২", "৩"); // returns "৬"
    multiply([2, 3, 4], undefined, true); // returns "24"
    multiply("১০", "৫", true); // returns "50"
    multiply([5, 10, 2]); // returns "১০০"

    If the input is invalid or not a number.