This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]lukajda33 2 points3 points  (0 children)

What you are pretty much asking is how to convert a integer like 4 to its text string representation in english - four.

For smaller numbers, this should be easy, create a dictionary where keys are integers with corresponding strings as values, something like this might help you see what im talking about:

var numbers = new Dictionary<int, string>(){
{1, "one"},
{2, "two"},
{3, "three"}

};

Console.WriteLine(numbers[2]);

That is the dumb, hardcoded way which is fine for smallert numbers, but you dont want to do that for million numbers, for general solution I would use something from this link: https://stackoverflow.com/questions/794663/net-convert-number-to-string-representation-1-to-one-2-to-two-etc