When input is given as number digit -> The output should be in words
It should also accept negative values.
It should also show decimal values in words
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joginder BangerPosted Dec 22, 2014, 2:16 AM
float tempvaluef = 12.3f;
string tempvalue = Convert.ToString(tempvaluef);
for (int i = 0; i < tempvalue.Length; i++)
{
wordvalue+= stringreturn(tempvalue[i]);
}
Response.Write(wordvalue);
string wordvalue;
string temp;
public string stringreturn(char value)
{
switch (value)
{
case '1':
temp = "One";
break;
case '2':
temp = "Two";
break;
case '3':
temp = "Three";
break;
case '.':
temp = "Dot";
break;
default:
temp = string.Empty;
break;
}
return temp;
}