Hey anyone know about a function in C# that converts numerical value in to words Like If I give Input: 53904 Then the output should be: FIFTY THREE THOUSAND NINE HUNDRED FOUR ONLY
Asked
Active
Viewed 1,157 times
1
-
2First lets try somthing man – Ullas Jun 03 '14 at 06:13
-
1have a look on this one: http://stackoverflow.com/questions/794663/net-convert-number-to-string-representation-1-to-one-2-to-two-etc – Apostrofix Jun 03 '14 at 06:20
-
@Robin no tags in titles, please. – CodeCaster Jun 03 '14 at 06:29
-
There are two duplicate questions(!!!), and one among them should also have to be locked. And why its not? – Bharadwaj Jun 03 '14 at 06:37
1 Answers
6
By far, the best solution for this is the .NET Humanizr. It installs a series of extension methods and you can use it just like this:
15.ToWords(); // Returns "Fifteen"
int i;
i = 1587;
i.ToWords(); // Returns "One Thousand Five Hundred and Eighty Seven"
This works not only for numbers, but it works on DateTime, TimeSpan, Enums and others. I have used it in one of projects and it works great!
In addition, it has several other language translations, so it'll work in other languages, if you need it to.

Icemanind
- 47,519
- 50
- 171
- 296