Click here to Skip to main content
15,894,460 members
Articles / Programming Languages / C#

Converting numbers to the word equivalent.

Rate me:
Please Sign up or sign in to vote.
4.91/5 (77 votes)
12 May 2013CPOL1 min read 137.1K   14  
If your tutor asks you to convert numbers to words (i.e. 565 to a string "Five hundred and sixty-five") then you are not alone! Here is the simplest, most foolproof way to do it.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
20 Aug 2010Simon Dufour
*Edited* EVEN MORE *Edited* Boosted Silic0re09 version. It will work with up to 10^3002 or 3003 characters or novenonagintanongentillion. I've also refactored it a bit for you to have a better grade. For sanity sake, I've put the delimiters in text files. You can download them...
Please Sign up or sign in to vote.
19 Aug 2010Ron Beyer
I'm sorry, but that's a horrible way to do it...Here is what I would do... public class NumberToWords { public static string ConvertToWords(int Number) { //Split the string into 3 part pieces string numStr = Number.ToString(); ...
Please Sign up or sign in to vote.
12 May 2013Thomas Daniels
This is an alternative for "Converting numbers to the word equivalent. "

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

Comments and Discussions