Skip to content

Number To words convertor with currency support. currently supported Languages are Arabic, Hindi, Nepali and English. Supported currencies out of the box are USD and SAR.

Notifications You must be signed in to change notification settings

fasilmarshooq/Bee.NumberToText

Repository files navigation

Number To Text

Bee.NumbertoWords is a light weight C# library for number to text conversion with currency support. Importantly it supports arabic for Saudi Riyal out of the box.

Supported Languages
  • English
  • Arabic
  • Hindi
  • Nepali
Supported Currencies
  • USD
  • SAR

Usage

Extension Methods for currency conversion
const decimal input = 5678.71M;
string result = input.ToArabicWords(Currency.USD);
//output "خَمْسَة ألف سِتَّة مائة ثَمَانِيَة و سَبْعُونَ دولار أمريكي و وَاحِد و سَبْعُونَ سنتا فقط"
string resultEng = input.ToEnglishWords(Currency.USD);
//output "Five thousand six hundred seventy eight USD and seventy one cents only"
Custom Convertor for other currencies
 var AmtToWords = new CurrencyWordsConverter(new CurrencyWordsConversionOptions
            {
                Culture = Culture.International,
                OutputFormat = OutputFormat.English,
                CurrencyUnit = "rupees",
                SubCurrencyUnit = "paisa",
                CurrencyUnitSeparator = "and"
            });

string actualResult = AmtToWords.ToWords(32152.12M);
//output "Thirty two thousand one hundred fifty two rupees and twelve paisa only"
Number To Text Extension Method
const decimal input = 5678.71M;
string result = input.ToWords();
//output "Five thousand six hundred seventy eight point seven one"

License

MIT

Free Software, Hell Yeah!

About

Number To words convertor with currency support. currently supported Languages are Arabic, Hindi, Nepali and English. Supported currencies out of the box are USD and SAR.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages