Ricardo Villamil Ricardo Villamil - 1 year ago 37
C# Question

Print value of number (int) spelled out

is there an out-of-box way to spell out an int in C#? For example if I have:

int a = 53;


I want to print:

"fifty three"


not

"53"


If not, does anybody have any examples on how to accomplis this?

Thanks!

Answer Source

You have to write that code yourself. If had to guess, I'd say it's not in the framework because it'd be near impossible to localize (there's much more to this than just the names of digits: word order, hyphen rules, etc).

This brings back memories because it was an assignment from my very first programming course back in college, so it shouldn't be too hard for you to write one just in English.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download