numberify-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Numberify-Text

Numberify Text is a JavaScript library that converts numbers written in text form to their numeric equivalents in various languages.

Installation

npm install numberify-text

Usage

import { numberifyText } from 'numberify-text';

Then you can use the numberifyText method to convert the numbers written in text inside a string to their numeric equivalents.

const sentence = "I have three apples and four oranges in ten boxes";
const result = numberifyText(sentence, 'en');

console.log(result); // Output: "I have 3 apples and 4 oranges in 10 boxes"

This library can handle numbers up to the billions, making it versatile for various applications.

const sentence = "there are three cats in two million seven hundred fifty thousand thirty-two houses";
const result = numberifyText(sentence, 'en');

console.log(result); // Output: "there are 3 cats in 2750032 houses"

Supported Languages

  • English (en)
  • Spanish (es)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Creator

License

[MIT]

Package Sidebar

Install

npm i numberify-text

Weekly Downloads

3

Version

1.0.5

License

MIT

Unpacked Size

17 kB

Total Files

9

Last publish

Collaborators

  • xavirn