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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Joginder BangerRank #360 · 7K reputationPosted Dec 21, 2014, 9:16 PM EST
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;
}