1.0.3 • Published 8 months ago

lao_num2word v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Lao Number to Words (lao_num2word)

A lightweight library to convert numbers into words in both English and Lao languages.

Features

  • Converts numbers to English words (e.g., 123 -> "one hundred twenty-three").
  • Converts numbers to Lao words (e.g., 123 -> "ໜຶ່ງຮ້ອຍຊາວສາມ").

Installation

Install the package using npm:

npm install lao_num2word

Usage

Import the Library

const { numberToWordsEN, numberToWordsLA } = require('lao_num2word');

// Convert an integer to English words
console.log(numberToWordsEN(123)); // "one hundred twenty-three"

// Convert a larger number
console.log(numberToWordsEN(4567)); // "four thousand, five hundred sixty-seven"

// Handle negative numbers
console.log(numberToWordsEN(-98)); // "minus ninety-eight"

// Ordinals (optional implementation required)
console.log(numberToWordsEN(21, true)); // "twenty-first"

// Convert an integer to Lao words
console.log(numberToWordsLA(123)); // "ໜຶ່ງຮ້ອຍຊາວສາມ"

// Convert a larger number
console.log(numberToWordsLA(4567)); // "ສີ່ພັນຫ້າຮ້ອຍສິບເຈັດ"

// Handle millions
console.log(numberToWordsLA(1234567)); // "ໜຶ່ງລ້ານສອງແສນສາມພັນສີ່ຮ້ອຍສິບເຈັດ"
1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago