Thursday 27 December 2012

Number To Words in C# - Source Code

In my previous post Number To Words in Java, I presented the code to convert a number to words in the Indian Numbering System (INS). Now I translated that code to C# so that it could be used in a .NET application. The translation was fairly easy as C# and Java's syntax resemble quit a lot.

The class in the translated code retains the same name which is NumberToWords. A typical usage of the class would be like this:

decimal number = 1084.92M;
string numberInWords =  (line break given for clarity)
NumberToWords.ConvertNumberToWords(number);

The class produces the same output as its corresponding Java class.

Class download link 
 

No comments:

Post a Comment