Convert Words To Numeric Digits – Numberify-Text

Category: Javascript | October 30, 2023
Views Total:30 views
Official Page:Go to website
Last Update:October 30, 2023


Convert Words To Numeric Digits – Numberify-Text


Numberify-Text is a JavaScript library that can take numbers written in words and convert them to numeric digits.

This can be super useful for applications that need to handle data inputted as text but store and process it as numbers. For example, if someone enters “one hundred twenty three” on a form, Numberify-Text can convert that to 123 for easier math and storage.

It works for numbers up to the billions and currently supports English and Spanish numeric text.

How to use it:

1. Install the numberify-text via NPM.

$ npm i numberify-text

2. Import the numberifyText in your project.

import { numberifyText } from 'numberify-text';

3. You pass a text number as a string and it will return the numeric equivalent.

const sentence = "There are about four thousand six hundred posts on CSSScript.Com.";
const result = numberifyText(sentence, 'en');
// => There are about 4600 posts on CSSScript.Com.

You Might Be Interested In:

Leave a Reply