Questions tagged [numbers-to-words]

Converting numbers to their English representation is a common programming challenge where the goal is to take a number as input and output it's English equivalent. For example: input 1024; output "One Thousand Twenty-Four".

Filter by
Sorted by
Tagged with
5 votes
1 answer
109 views

Number to Text converter in Haskell

I've written this code in Haskell to convert a number into its written form. It feels ok but at the same time I feel like it can probably be improved on a lot. I would appreciate help in improving it. ...
user avatar
1 vote
0 answers
87 views

PowerShell - Convert English words describing numbers to their values in Arabic numeral

I am extremely new to programming, and I am a really fast learner if I am interested, I have only started using PowerShell in less than a month, to improve my programming skill, this is a script I ...
user avatar
3 votes
1 answer
993 views

Indian Numbering System - converting into the Official and Common-Use Numbering Systems Words/Strings

I have developed the following short JavaScript function to convert numbers to the Indian Numbering System formats; both the Official Numbering System and the Common-Use System (i.e. using the Lakh-...
user avatar
9 votes
1 answer
769 views

Number in words: recursive function

I would appreciate some feedback on the below code I wrote for a Project Euler problem. The answer comes out correct but I'd like feedback on the design of the function and implementation of ...
user avatar
26 votes
5 answers
6k views

Japanese reading of an integer

Inspired by CtCI 16.8: Integer to English phrase in C++, I wrote a program to show the Japanese reading of an integer (positive, negative, or zero). The Japanese is written in Hepburn romanization to ...
user avatar
  • 8,937
7 votes
1 answer
229 views

CtCI 16.8: Integer to English phrase in C++

I'm a C++ beginner working through Cracking the Coding Interview. This is question 16.8: Given any integer, print an English phrase that describes the integer (e.g., "One Thou­sand, Two Hundred ...
user avatar
  • 790
3 votes
1 answer
661 views

Project Euler #17: Number Letter Counts

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive ...
user avatar
4 votes
2 answers
178 views

Simple Number to Words using a Single Loop String Triplets in VBA

As an update (conversion) to my article “Simple Number to Words using a Single Loop String Triplets in JavaScript” in JavaScript, I have converted the code to work as a VBA function using the same ...
user avatar
9 votes
4 answers
985 views

Simple Number to Words using a Single Loop String Triplets in JavaScript

I have extensively reviewed 2 old articles on the subject: https://stackoverflow.com/questions/14766951/convert-digits-into-words-with-javascript and https://stackoverflow.com/questions/5529934/...
user avatar
6 votes
2 answers
421 views

Very Simple Spell (Number to Words) 001 to 999 in VBA

I have come across many spell number functions and have reviewed many VBA code available on the net. The core function that gets called repeatedly is the function that converts numbers from 001 to ...
user avatar
17 votes
3 answers
9k views

Converting numbers to words - Python

I'm new to programming. I tried to find a way to convert numbers into letters with Python. I would like to receive some advice to improve myself. This program works for numbers between 1 and 106 and ...
user avatar
1 vote
0 answers
114 views

Number Stringifier in Clojure

As an exercise, I decided to write a program that spells out numbers. For example: (stringify-int 12345) => "twelve thousand three hundred forty-five" It ...
user avatar
8 votes
3 answers
3k views

Integers to English words in C

As a beginner in C programming, I decided to write a function words that, given an unsigned integer n, puts the English ...
user avatar
  • 83
2 votes
1 answer
233 views

A program that spells a given number [1-999,999,999,999]

This program created by me spells a number in the standard notation (Billions, Millions etc). I was wondering if there is a better way to do the same thing, or if I have been a victim of some of the ...
user avatar
2 votes
1 answer
1k views

Python Converting numbers to words, using Recursive

My function recursively calls itself until it decodes every numbers. rec_ntw face_value_count -> (Incremental variable) denotes ones, tens, hundreds and thousands face_value -> (Dictionary) denotes ...
user avatar
  • 23
19 votes
4 answers
9k views

Converting a large number into something like: 4 Novemnongent

This is not a school project, just something to help me learn some Python! Just looking to see what I can improve on, looking for tips to reduce size & make it a bit easier for the computer to run ...
user avatar
3 votes
0 answers
384 views

Converting English words to numbers in Haskell

A few weeks ago, I finished a number to word converter and received an excellent review. It caused me to make several fundamental changes to numToWord, such as ...
user avatar
  • 809
7 votes
1 answer
2k views

Converting numbers to words in Haskell

Here's a program I wrote to convert numbers into English words using Haskell. ...
user avatar
  • 809
4 votes
3 answers
700 views

Number to word converter (1 to 99 inclusive)

Program It takes a numerical input in range [1, 99] and outputs its word equivalent. Concerns Procedural approach General code style Code ...
user avatar
  • 363
6 votes
2 answers
2k views

Number to words in Python 3

Here is a sample program I have written to convert numbers to words: ...
user avatar
2 votes
1 answer
1k views

Number to text conversion (Check writing application)

How It Works: Inspired by r/dailyprogrammer, the application uses regular expressions to group 1-3 digits at a time from right to left, each captured group is then converted to text. Program Class <...
user avatar
  • 686
7 votes
4 answers
36k views

Converting number to words

First it asks for user to input a number and it will convert it into words. For example: 104382426112 to ...
user avatar
6 votes
1 answer
1k views

Convert time 24hr format into time as words

I'm currently writing a Scala Object that converts time 24hr format (i.e. 00:00 - 23:59) into Time As Words (i.e. Eight o'clock, Half past eight, Quarter to nine etc). How can I refactor the current ...
user avatar
6 votes
4 answers
258 views

Converts number in text format function code

I have created a function which converts numbers into text format and successfully converted up to 6 digit numbers. However, I want to know if I can make any modifications to make the code shorter. ...
user avatar
13 votes
2 answers
2k views

Create the English word for a number

I cobbled together a function from various sources that takes an integer and returns it as its respective English word formatted as a string. The function is as follows: ...
user avatar
4 votes
1 answer
122 views

Measuring the length of binary numbers in English words in C

Inspired by this question (link to original video), I decided to write some code in C to perform this task, and it is much faster than the Python code, even when run with PyPY, up to a billion, it ...
user avatar
  • 27k
10 votes
2 answers
1k views

Number to English word converter

This is a simple program that I wrote. It takes a 64-bit unsigned int as input and returns its English name. ...
user avatar
1 vote
2 answers
5k views

Function to spell numbers below 1,000,000,000 [closed]

I wrote simple code to spell the number below 1,000,000,000. It works perfectly as per my intention. However, I do think my code is a little bit messy since I only able to imagine of using decision ...
user avatar
  • 157
3 votes
1 answer
1k views

Convert an Integer number to readable format in Java

The number is ranging from 1 to 999999999. ...
user avatar
5 votes
2 answers
208 views

Integer to English challenge

I have a challenge, which is to create a JavaScript function that turns a given number into the string representation. For example: console.log(inToEnglish(15)) ...
user avatar
2 votes
0 answers
442 views

Number-to-words translator

I've created a class that translates an integer into words in an English (not British) format. My first human language is not English, and I don't have a good idea of a truly right way to read numbers,...
user avatar
2 votes
1 answer
272 views

Method to convert numbers into plain text

I'm relatively new to Java, and over the past week or so I've just been reading through the docs and messing around with it to better improve my understanding. As stated in the title, I've created a ...
user avatar
4 votes
4 answers
2k views

Project Euler 17: counting letters needed to write numbers

The statement of the problem is : If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers ...
user avatar
4 votes
1 answer
3k views

Decimal numbers to English string representation

Is there anything that I could have reworked here? I have a Java 7 mind but I'm working on getting my Java 8 ready, so if there are any improvements over readability of performance here I'd love to ...
user avatar
  • 615
4 votes
1 answer
1k views

Converting a number into Hungarian text

I'd like to convert some integer number from a cell between 0 and 1,000,000,0000 into Hungarian text. I've found already a solution, a VBA function. How can be improved this solution? ...
user avatar
40 votes
6 answers
3k views

SHOUTY_SNAKE_CASED NUMBERS

WE_ALL_LOVE_SHOUTY_SNAKE_CASE_SO_I_WROTE_A_PROGRAM_FOR_IT!!1! Alright, enough of this. This is a rags-to-riches from this question. The pattern is pretty simple, it takes a ...
user avatar
  • 12.2k
2 votes
1 answer
286 views

Text representation for numbers with python

Simple function which returns a text representation for numbers in range [1...1000]. ...
user avatar
4 votes
1 answer
344 views

Print and calculate French written numbers from 1 to 1000 using imperative Java

I've written a little (imperative) java program that basically prints out all french written numbers from 1 to 1000. (I'm learning how to write them) Based on the first numbers (1-16) and the tens ...
user avatar
  • 193
5 votes
1 answer
2k views

Project Euler no. 17: Counting letters to write the numbers from 1 to 1000

I'm very new to programming and am admittedly embarrassed sharing my code for critique. This code works and produces the correct answer to the Project Euler Problem 17, which asks how many letters ...
user avatar
6 votes
2 answers
1k views

Number to spanish word converter

This converts from a number to a Spanish word for example : 100 => cien 200 => doscientos I used a divide-and-conquer approach: Constants: ...
user avatar
  • 2,964
15 votes
2 answers
254 views

One, two, three, … Un, deux, trois, …, maxBound::Int

I wrote a numbers-to-words converter for English, then tried to adapt the code to work for French. I'm wondering mainly whether any simplifications are possible. In English English is relatively ...
user avatar
1 vote
3 answers
14k views

Number to Word Application in C#

I've created a Windows Form Number to Word converter application in C# which converts any number from 0 to 1 million. I would love a review based on efficiency and best practices. MainInterface.cs <...
user avatar
3 votes
2 answers
4k views

Converting numbers to English words

This is a simple program to convert a number, from 0 up to 99999999, to English words. Example: If the input is: 1234 The output would be: one thousand two ...
user avatar
  • 3,248
3 votes
2 answers
946 views

Integer to English Conversion

I wrote some code to translate numbers ( for now just positive, up to the 32bit limit ) into English words. Everything works and I'm happy. I searched through the site looking for a comparison code ...
user avatar
12 votes
1 answer
372 views

Convert any number (up to 10^3000) to text

I kinda got the idea after playing Adventure Capitalist, since that goes up to 10300. I found a website that explained how to go up to 10^3000, so I mainly did this as a challenge to see if I could do ...
user avatar
  • 1,105
8 votes
1 answer
2k views

Code to convert number to words

I am trying to practice objects and functions (specifically closures & higher order functions) in javascript. There is no specific reason why I chose this program but it struck my mind to work out ...
user avatar
  • 181
12 votes
2 answers
29k views

Changing Number to Words in JavaScript

One day I saw a question on Stack Overflow asking about changing numbers to words, I thought about it, and next day I started coding. When I had the code working, I thought it could, most likely, be ...
user avatar
  • 223
5 votes
1 answer
1k views

Putting numbers into words

I have some embarrassingly long code which puts into words any number up into the trillions. As a newbie, and understanding that shorter, non-repetitive code is best, I am looking for suggestions on ...
user avatar
  • 149
3 votes
0 answers
102 views

Generation and parsing of English numerals (cardinal and ordinal)

I need to use the English numerals (American) in Haskell, so I looked for a library that did it. I have not found one, therefore I developed the program that I am presenting here. There are actually ...
user avatar
0 votes
3 answers
195 views

My take at ProjectEuler #17 - counting counting characters

I tried to tackle #17 problem on Project Euler: If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are \$3 + 3 + 5 + ...
user avatar