NumericWordsConversion 2.1.1
dotnet add package NumericWordsConversion --version 2.1.1
NuGet\Install-Package NumericWordsConversion -Version 2.1.1
<PackageReference Include="NumericWordsConversion" Version="2.1.1" />
<PackageVersion Include="NumericWordsConversion" Version="2.1.1" />
<PackageReference Include="NumericWordsConversion" />
paket add NumericWordsConversion --version 2.1.1
#r "nuget: NumericWordsConversion, 2.1.1"
#addin nuget:?package=NumericWordsConversion&version=2.1.1
#tool nuget:?package=NumericWordsConversion&version=2.1.1
Numeric Words Conversion
Numeric Words Conversion is a C# library for converting numeric into words. The goal is to create a simple customizable library which can easily be used to convert any numbers or currencies to words.
Usage
For Numeric
decimal amount = 100000.12;
NumericWordsConverter converter = new NumericWordsConverter();
string words = converter.ToWords(amount)
//OR SIMPLY
string words = amount.ToNumericWords();
//Outputs: One hundred thousand point one two
- Supports Multiple Numeral Systems with multiple output formats
- International English
//Eg: One hundred thousand
- Nepali and Hindi
Supports multiple output formats
- Output Format : English
Eg: 100000.1 outputs One lakh point one
- Output Format : Unicode
Eg: 100000.1 outputs एक लाख दशमलव एक
- Output Format : Devnagari
Eg: 100000.1 outputs Ps nfv bzdnj Ps //Makes sense in Devnagari fonts
- Output Format : English
- International English
For Currency
Supports Nepali, Hindi and International currency system out of the box. By default, uses International currency system.
decimal amount = 100000.12;
CurrencyWordsConverter converter = new CurrencyWordsConverter();
string words = converter.ToWords(amount)
//OR SIMPLY
string words = amount.ToCurrencyWords();
//Outputs: One hundred thousand dollar and twelve cents only
And you can customize it as you like by passing the options parameter
CurrencyWordsConverter converter = new CurrencyWordsConverter(new CurrencyWordsConversionOptions()
{
Culture = Culture.Nepali,
OutputFormat = OutputFormat.English
});
string words = converter.ToWords(100000.12M);
//Outputs: One lakh rupees and twelve paisa only
You can even specify your own currency units and fully customize it your own way.
CurrencyWordsConverter converter = new CurrencyWordsConverter(new CurrencyWordsConversionOptions()
{
Culture = Culture.International,
OutputFormat = OutputFormat.English,
CurrencyUnitSeparator = string.Empty,
CurrencyUnit = "pound",
SubCurrencyUnit = "pence",
EndOfWordsMarker = ""
});
string words = converter.ToWords(00000.12M);
//Outputs: One hundred thousand pound twelve pence
Need single conversion options through out the application? You can override the default options as desired. Just use the following code in startup file of the project
NumericWordsConfiguration.ConfigureConversionDefaults(options =>
{
//For Numeric Words Conversion
options.SetDefaultNumericWordsOptions(new NumericWordsConversionOptions
{
Culture = Culture.International,
DecimalSeparator = "dot",
DecimalPlaces = 2
});
});
//For Currency Words Conversion
options.SetDefaultCurrencyWordsOptions(new CurrencyWordsConversionOptions
{
Culture = Culture.Nepali,
OutputFormat = OutputFormat.English,
CurrencyUnitSeparator = "and",
CurrencyUnit = "rupee",
CurrencyNotationType = NotationType.Prefix,
SubCurrencyUnit = "paisa",
EndOfWordsMarker = "and"
});
And simply use the extension method anywhere in the application, as
decimal amount = 100000.01M;
amount.ToNumericWords(); //Outputs: One hundred thousand dot zero one.
amount.ToCurrencyWords(); //Outputs: Rupees one lakh and one paisa.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release with support for all .NET versions upto 10, .NET Standard 2.0, and .NET Framework 4.8.