Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSid K
Courses Plus Student 206 Pointsdigit to word conversion
how to convert digits to words in asp.net and in c#
2 Answers
Steven Parker
231,184 PointsYou probably want the .ToString() method.
Depending on the context there will likely be other choices, but invoking the .ToString() method on a numeric literal or variable is a good generic way to convert a number to a string.
On the other hand, if by "words" you mean things like "two hundred thirty six", you're probably doing a homework assignment, and you will need to write a program for that.
Remco de Wilde
9,864 Pointsa quick search on stackoverflow gives you this solution
http://stackoverflow.com/questions/2729752/converting-numbers-in-to-words-c-sharp
Steven Parker
231,184 PointsGive a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.
― Maimonides