Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makes GermanNumberToWordsConverterBase static #1456

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

abstract class GermanNumberToWordsConverterBase : GenderedNumberToWordsConverter
{
readonly string[] UnitsMap = ["null", "ein", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun", "zehn", "elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"];
readonly string[] TensMap = ["null", "zehn", "zwanzig", "dreißig", "vierzig", "fünfzig", "sechzig", "siebzig", "achtzig", "neunzig"];
readonly string[] UnitsOrdinal = [string.Empty, "ers", "zwei", "drit", "vier", "fünf", "sechs", "sieb", "ach", "neun", "zehn", "elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"];
readonly string[] HundredOrdinalSingular = ["einhundert"];
readonly string[] HundredOrdinalPlural = ["{0}hundert"];
readonly string[] ThousandOrdinalSingular = ["eintausend"];
readonly string[] ThousandOrdinalPlural = ["{0}tausend"];
readonly string[] MillionOrdinalSingular = ["einmillion", "einemillion"];
readonly string[] MillionOrdinalPlural = ["{0}million", "{0}millionen"];
readonly string[] BillionOrdinalSingular = ["einmilliard", "einemilliarde"];
readonly string[] BillionOrdinalPlural = ["{0}milliard", "{0}milliarden"];
static string[] UnitsMap = ["null", "ein", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun", "zehn", "elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be static readonly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

static string[] TensMap = ["null", "zehn", "zwanzig", "dreißig", "vierzig", "fünfzig", "sechzig", "siebzig", "achtzig", "neunzig"];
static string[] UnitsOrdinal = [string.Empty, "ers", "zwei", "drit", "vier", "fünf", "sechs", "sieb", "ach", "neun", "zehn", "elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"];
static string[] HundredOrdinalSingular = ["einhundert"];
static string[] HundredOrdinalPlural = ["{0}hundert"];
static string[] ThousandOrdinalSingular = ["eintausend"];
static string[] ThousandOrdinalPlural = ["{0}tausend"];
static string[] MillionOrdinalSingular = ["einmillion", "einemillion"];
static string[] MillionOrdinalPlural = ["{0}million", "{0}millionen"];
static string[] BillionOrdinalSingular = ["einmilliard", "einemilliarde"];
static string[] BillionOrdinalPlural = ["{0}milliard", "{0}milliarden"];

public override string Convert(long number, GrammaticalGender gender, bool addAnd = true)
{
Expand Down