Skip to main content
Version: 3.0.10 (latest)

Humanizer.INumberToWordsConverter

INumberToWordsConverter Interface

An interface you should implement to localise ToWords and ToOrdinalWords methods

public interface INumberToWordsConverter

Methods

INumberToWordsConverter.Convert(long) Method

Converts the number to string using the locale's default grammatical gender

string Convert(long number);

Parameters

number System.Int64

Returns

System.String

INumberToWordsConverter.Convert(long, bool) Method

Converts the number to string using the locale's default grammatical gender with or without adding 'And'

string Convert(long number, bool addAnd);

Parameters

number System.Int64

addAnd System.Boolean

Specify with our without adding "And"

Returns

System.String

INumberToWordsConverter.Convert(long, bool, WordForm) Method

Converts the number to a specific string form using the locale's default grammatical gender with or without adding 'And'

string Convert(long number, bool addAnd, Humanizer.WordForm wordForm);

Parameters

number System.Int64

addAnd System.Boolean

wordForm WordForm

Returns

System.String

INumberToWordsConverter.Convert(long, GrammaticalGender, bool) Method

Converts the number to string using the provided grammatical gender

string Convert(long number, Humanizer.GrammaticalGender gender, bool addAnd=true);

Parameters

number System.Int64

gender GrammaticalGender

addAnd System.Boolean

Returns

System.String

INumberToWordsConverter.Convert(long, WordForm) Method

Converts the number to a specific string form using the locale's default grammatical gender.

string Convert(long number, Humanizer.WordForm wordForm);

Parameters

number System.Int64

wordForm WordForm

Returns

System.String

INumberToWordsConverter.Convert(long, WordForm, GrammaticalGender, bool) Method

Converts the number to a specific string form using the provided grammatical gender.

string Convert(long number, Humanizer.WordForm wordForm, Humanizer.GrammaticalGender gender, bool addAnd=true);

Parameters

number System.Int64

wordForm WordForm

gender GrammaticalGender

addAnd System.Boolean

Returns

System.String

INumberToWordsConverter.ConvertToOrdinal(int) Method

Converts the number to ordinal string using the locale's default grammatical gender

string ConvertToOrdinal(int number);

Parameters

number System.Int32

Returns

System.String

INumberToWordsConverter.ConvertToOrdinal(int, GrammaticalGender) Method

Converts the number to ordinal string using the provided grammatical gender

string ConvertToOrdinal(int number, Humanizer.GrammaticalGender gender);

Parameters

number System.Int32

gender GrammaticalGender

Returns

System.String

INumberToWordsConverter.ConvertToOrdinal(int, GrammaticalGender, WordForm) Method

Converts the number to a specific ordinal string form using the provided grammatical gender.

string ConvertToOrdinal(int number, Humanizer.GrammaticalGender gender, Humanizer.WordForm wordForm);

Parameters

number System.Int32

gender GrammaticalGender

wordForm WordForm

Returns

System.String

INumberToWordsConverter.ConvertToOrdinal(int, WordForm) Method

Converts the number to a specific ordinal string form using the locale's default grammatical gender.

string ConvertToOrdinal(int number, Humanizer.WordForm wordForm);

Parameters

number System.Int32

wordForm WordForm

Returns

System.String

INumberToWordsConverter.ConvertToTuple(int) Method

Converts integer to named tuple (e.g. 'single', 'double' etc.).

string ConvertToTuple(int number);

Parameters

number System.Int32

Returns

System.String