🌐
CalculatorSoup
calculatorsoup.com β€Ί calculators β€Ί conversions β€Ί numberstowords.php
Numbers to Words Converter
Convert numbers to words, numbers to USD currency, and currency to words. Includes how to write a check. Use this converter to translate numbers to words in English.
🌐
Boxentriq
boxentriq.com β€Ί home β€Ί code-breaking β€Ί letters to numbers
Letters to Numbers Converter | Boxentriq
Convert letters into numbers instantly! Just type or paste your text, choose language and code type, and see the result. Punctuation and other unconvertible characters are ignored automatically. Switch to πŸ”€ Numbers to Letters.
Discussions

JavaScript numbers to Words - Stack Overflow
I'm trying to convert numbers into english words, for example 1234 would become: "one thousand two hundred thirty four". My Tactic goes like this: Separate the digits to three and put th... More on stackoverflow.com
🌐 stackoverflow.com
Why do some American phone numbers have words in them? How do you call such a number?
If you look at the dial pad of a phone, they often have letters under, each number. So for instance under the number 2 there is usually 'ABC', 3 is 'DEF' etc. So when a number is like 1-800-BEEF, it's the same as 1-800-2333. The idea being words are easier to remember without writing it down. More on reddit.com
🌐 r/NoStupidQuestions
5
2
June 26, 2014
Threeven and Throdd: Words to Describe Numbers Divisible/Not Divisible by Three?
It would be cooler if you had three words, one for each categorie of number (0 ,1 or 2 modulo 3) More on reddit.com
🌐 r/dozenalsystem
17
13
June 3, 2020
Library for converting numbers to words
Nice! You can also do something like that with the NumberFormatter from php-intl: $fmt = new NumberFormatter('en_US', NumberFormatter::SPELLOUT); echo $fmt->format(1142) . PHP_EOL; one thousand one hundred forty-two More on reddit.com
🌐 r/PHP
29
34
January 14, 2014
🌐
Character Calculator
charactercalculator.com β€Ί numbers-to-words
Numbers to Words Converter - Amount in Words
Numbers to words converter. Convert any number with or without decimals to words. Also shows currency in words.
🌐
AllMath
allmath.com β€Ί TexttoNumberConverter.php
Words to Numbers Converter
Words to numbers converter is used to convert the words into numbers & figures. This converter takes alphabetical words and converts them into numbers.
🌐
Code Beautify
codebeautify.org β€Ί number-to-word-converter
Numbers to Words Converter from 0 to nonillion
Numbers to Words Converter is an easy-to-use tool to convert Numbers to Readable Strings.
🌐
Richland College
people.richland.edu β€Ί james β€Ί ictcm β€Ί 2001 β€Ί dating β€Ί dating.pdf pdf
Conversion Table A = 1 B = 2 C = 3 D = 4 E = 5 F = 6 G = 7 H = 8 I = 9 J = 10
Rearrange the letters into alphabetical order. This is not necessary to find the Β· standard deviation, but it helps visualize the name ... Find the median letter for your name. The median letter would be the letter in the Β· middle (if you have an odd number of letters) or the midpoint between the two
🌐
Code Beautify
codebeautify.org β€Ί word-to-number-converter
Words to Numbers Converter: Support Zero to Million to Decillion
Copy, Paste and Convert to Number. "Words to numbers" refers to converting words or text representing a numerical value into its corresponding numerical form.
Find elsewhere
🌐
LingoJam
lingojam.com β€Ί NumbersToWords
Numbers To Words Converter (e.g. 1000000 β†’ one million) ― LingoJam
This translator converts numbers into words (or numbers to letters, if that makes more sense). Write "1" in the box on the left, and "one" will appear on the right. It converts very large numbers into their word form - see if you can find the biggest!
🌐
EasySurf
easysurf.cc β€Ί cnvert18.htm
Convert numbers into words (from 0 to 999,999,999,999,999) Dollars and Cents, integers or decimal fractions
If you want to type "256,678", but you type "25k,678", the computer will use "25678" to calculate the answer. If you type "653.67", the computer will use "653" to calculate the answer. To convert ".67" into words, type "67" to the right of the decimal point in the "Enter decimal fraction" box.
🌐
LambdaTest
lambdatest.com β€Ί home β€Ί free tools β€Ί words to numbers
Words to Numbers Converter Online | LambdaTest
Add-Ins: Install third-party add-ins designed for number conversion to extend Excel’s functionality. Using Formulas: Similar to Excel, Google Sheets does not have a built-in function for this. You can use Google Apps Script to create a custom function. Add-Ons: Utilize Google Sheets add-ons available in the G Suite Marketplace for converting words to numbers.
🌐
Num2Word
num2word.com
Convert Numbers to Words | Number to Words in Hindi | Amount to Words
Convert Number or Amount in words, The amount you enter here will convert in words in both English and Hindi language. It's a free tool to help you in day to day task. Just enter the amount or number and click on "Convert in Words" button you will get your number, converted in words.
Top answer
1 of 16
38

Your problem is already solved but I am posting another way of doing it just for reference.

The code was written to be tested on node.js, but the functions should work fine when called within the browser. Also, this only handles the range [0,1000000], but can be easily adapted for bigger ranges.

// actual  conversion code starts here

var ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
var tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
var teens = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];

function convert_millions(num) {
  if (num >= 1000000) {
    return convert_millions(Math.floor(num / 1000000)) + " million " + convert_thousands(num % 1000000);
  } else {
    return convert_thousands(num);
  }
}

function convert_thousands(num) {
  if (num >= 1000) {
    return convert_hundreds(Math.floor(num / 1000)) + " thousand " + convert_hundreds(num % 1000);
  } else {
    return convert_hundreds(num);
  }
}

function convert_hundreds(num) {
  if (num > 99) {
    return ones[Math.floor(num / 100)] + " hundred " + convert_tens(num % 100);
  } else {
    return convert_tens(num);
  }
}

function convert_tens(num) {
  if (num < 10) return ones[num];
  else if (num >= 10 && num < 20) return teens[num - 10];
  else {
    return tens[Math.floor(num / 10)] + " " + ones[num % 10];
  }
}

function convert(num) {
  if (num == 0) return "zero";
  else return convert_millions(num);
}

//end of conversion code

//testing code begins here

function main() {
  var cases = [0, 1, 2, 7, 10, 11, 12, 13, 15, 19, 20, 21, 25, 29, 30, 35, 50, 55, 69, 70, 99, 100, 101, 119, 510, 900, 1000, 5001, 5019, 5555, 10000, 11000, 100000, 199001, 1000000, 1111111, 190000009];
  for (var i = 0; i < cases.length; i++) {
    console.log(cases[i] + ": " + convert(cases[i]));
  }
}

main();
2 of 16
32

JavaScript is parsing the group of 3 numbers as an octal number when there's a leading zero digit. When the group of three digits is all zeros, the result is the same whether the base is octal or decimal.

But when you give JavaScript '009' (or '008'), that's an invalid octal number, so you get zero back.

If you had gone through the whole set of numbers from 190,000,001 to 190,000,010 you'd hav seen JavaScript skip '...,008' and '...,009' but emit 'eight' for '...,010'. That's the 'Eureka!' moment.

Change:

for (j = 0; j < finlOutPut.length; j++) {
    finlOutPut[j] = triConvert(parseInt(finlOutPut[j]));
}

to

for (j = 0; j < finlOutPut.length; j++) {
    finlOutPut[j] = triConvert(parseInt(finlOutPut[j],10));
}

Code also kept on adding commas after every non-zero group, so I played with it and found the right spot to add the comma.

Old:

for (b = finlOutPut.length - 1; b >= 0; b--) {
    if (finlOutPut[b] != "dontAddBigSufix") {
        finlOutPut[b] = finlOutPut[b] + bigNumArry[bigScalCntr] + ' , ';
        bigScalCntr++;
    }
    else {
        //replace the string at finlOP[b] from "dontAddBigSufix" to empty String.
        finlOutPut[b] = ' ';
        bigScalCntr++; //advance the counter  
    }
}

    //convert The output Arry to , more printable string 
    for(n = 0; n<finlOutPut.length; n++){
        output +=finlOutPut[n];
    }

New:

for (b = finlOutPut.length - 1; b >= 0; b--) {
    if (finlOutPut[b] != "dontAddBigSufix") {
        finlOutPut[b] = finlOutPut[b] + bigNumArry[bigScalCntr]; // <<<
        bigScalCntr++;
    }
    else {
        //replace the string at finlOP[b] from "dontAddBigSufix" to empty String.
        finlOutPut[b] = ' ';
        bigScalCntr++; //advance the counter  
    }
}

    //convert The output Arry to , more printable string 
    var nonzero = false; // <<<
    for(n = 0; n<finlOutPut.length; n++){
        if (finlOutPut[n] != ' ') { // <<<
            if (nonzero) output += ' , '; // <<<
            nonzero = true; // <<<
        } // <<<
        output +=finlOutPut[n];
    }
🌐
CodeShack
codeshack.io β€Ί words-to-numbers-converter
Words to Numbers Converter - Online Tool
Convert numbers written in English words (e.g., one hundred twenty-three) into their numerical digit representation (123). Supports various formats.
🌐
Utilities and Tools
utilities-online.info β€Ί word-to-number-converter
Word to Number Converter
Convert words into their numerical representation. ... Your Feedback submitted successfully. ... View a reference table of ASCII characters and their corresponding codes. Convert ASCII characters to their corresponding decimal values.
🌐
Boxentriq
boxentriq.com β€Ί home β€Ί code-breaking β€Ί numbers to letters
Numbers to Letters Converter | Boxentriq
Convert numbers into letters instantly! Just type or paste your numbers, choose language and code type, and see the text appear. Any invalid or-non-convertible numbers are shown as #. Switch to πŸ”€ Letters to Numbers.
🌐
DCode
dcode.fr β€Ί communication system β€Ί numeral system β€Ί words in numbers
Words to Numbers Converter - Write Word Into Figures - Online
When a number becomes long (for large numbers), it is easier to read it by dividing it into groups of three digits, starting from the right. Each group is then read separately, associating it with the word that corresponds to its power of ten (thousand, million, billion, etc.).
🌐
YouTube
youtube.com β€Ί simplilearn
How to Convert Number to Words in Excel? | Converting Number to Words in Excel | Simplilearn - YouTube
πŸ”₯ Post Graduate Program In Business Analysis: https://www.simplilearn.com/pgp-business-analysis-certification-training-course?utm_campaign=HowtoConvertNumbe
Published Β  August 19, 2022
Views Β  200K