Function convertEachDigitsToWords

  • Converts each digit of a number to its corresponding word representation, including zeros.

    Parameters

    • number: string | number

      The number to convert (can be a number or string).

    • inEnglish: boolean = false

      If true, converts the digits to English words. Default is false (converts to Bangla words).

    Returns string

    The number with each digit converted to words, including zeros.

    If the input is not a valid number or number string.

    convertEachDigitsToWords(10203); // "এক শূন্য দুই শূন্য তিন"
    convertEachDigitsToWords(10203, true); // "one zero two zero three"
    convertEachDigitsToWords("১০২০৩", true); // "one zero two zero three"
    convertEachDigitsToWords("100.05"); // "এক শূন্য শূন্য দশমিক শূন্য পাঁচ"
    convertEachDigitsToWords("১০০.০৫", true); // "one zero zero point zero five"