pols-utils - v5.3.11
    Preparing search index...

    Function write

    • Converts a numeric value to its written representation.

      Parameters

      • value: number

        The number value to convert.

      • decimals: { decimals?: number; language?: PLanguages } = {}

        The number of decimal places to include in the output.

      Returns string

      A string representing the number in words.

      console.log(write(123)) // 'ONE HUNDRED TWENTI THREE'
      console.log(write(123.45, 2)) // 'ONE HUNDRED TWENTI THREE AND 45/100'
      console.log(write(123.4567, 3)) // 'ONE HUNDRED TWENTI THREE AND 457/1000'
      console.log(write(123.999, 0)) // 'ONE HUNDRED TWENTI FOUR'