nummify
v1.0.2
Published
A lightweight library for converting numbers into their written word representation in multiple languages.
Downloads
5
Maintainers
Readme
nummify
nummify is a lightweight and intuitive library designed for converting numbers into their written word representation in multiple languages. With its straightforward API, you can easily integrate it into any project to enhance number handling and presentation.
Installation
You can install nummify
using any of the following package managers:
npm
npm install nummify
yarn
yarn add nummify
pnpm
pnpm add nummify
bun
bun add nummify
Usage
Getting started with nummify
is simple. Here’s how to use the library:
ES6 Import
import numReader from 'nummify';
console.log(numReader.readNumbers('1234.5', 'en')); // Output: "one thousand two hundred thirty four point five"
console.log(numReader.readNumbers('1234.5', 'ar')); // Output: "الف ومئتان وأربعة وثلاثون فاصلة خمسة"
CommonJS Require
const numReader = require('nummify');
console.log(numReader.readNumbers('1234.5', 'en')); // Output: "one thousand two hundred thirty four point five"
console.log(numReader.readNumbers('1234.5', 'ar')); // Output: "الف ومئتان وأربعة وثلاثون فاصلة خمسة"
Supported Languages
ar
: Arabicen
: English
Features
- Simplicity: Easy to use with minimal setup required.
- Multi-language Support: Converts numbers to words in both Arabic and English.
- Versatile Handling: Supports various number formats, including decimals and negative numbers.
- Lightweight: Designed to be unobtrusive and efficient, making it ideal for any project.
Contributing
Contributions are encouraged! Please feel free to submit a pull request or open an issue to improve the library.
License
This project is licensed under the ISC License. See the LICENSE file for details.