- NuGet:
dotnet add package TWord
Library to transform number or amount of money to words.
Language |
---|
English |
Germany |
Polish |
If language that interest you is not listed - create issue, I will do my best to add it.
Using ISO-4217
Currency |
---|
EUR |
PLN |
USD |
If currency that interest you is not listed - create issue, I will do my best to add it.
Flag icons comes from https://github.com/tkrotoff/famfamfam_flags
To transform number to words use code like below.
public static class Program
{
INtWord nt = new NtWordBuilder()
.SetLanguage(Language.English)
.Build();
var words = nt.ToWords(56123);
// Words is equal to
// fifty six thousand one hundred twenty three
}
Method | Description |
---|---|
SetLanguage(Language) | sets the language. See: availabe languages |
To transform amount of money to words use code like below.
public static class Program
{
IAtWord at = new AtWordBuilder()
.SetLanguage(Language.English)
.SetCurrency(CurrencySymbol.USD)
.Build();
var words = at.ToWords(56123.01m);
// Words is equal to
// fifty six thousand one hundred twenty three dollars one cent
}
Method | Description |
---|---|
SetLanguage(Language) | sets the language. See: availabe languages |
SetCurrency(CurrencySymbol) | sets the currency. See: availabe currencies |
IntegerPartOnly() | omnits decimal part from given amount. Example: 100.04 returns one hundred dollars |
DecimalPartAsFraction() | displays decimal part as fraction. Example: 100.04 returns one hundred dollars 4/100 cents |
HideSubunit() | hides decimal part as fraction. usually use with DecimalPartAsFraction(). Example: 100.04 returns one hundred dollars 4/100 |
IntegerAndDecimalPartSeparator(string) | sets integer and decimal part separator. If separator is and , value is 100.04 result will be one hundred dollars and four cents |