Posts

Showing posts with the label number

Number to String conversion

Hi, Generally in finance or banking or this kind of requirement is needed. Its more or less a common thing to convert a number to a string. I used this to convert currency to words format. Here is the snippet. /// /// Numbers to text. /// /// The value. /// public string NumberToText(int value) { string[] num0to10 = new string[] { "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten" }; string[] num11to20 = new string[] { "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty" }; string[] num20to100 = new string[] { "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety...