CardinalWordsTransformation class

A transformation to convert an input int into cardinal form.

This transformation converts the input to its cardinal form (1 becomes one, 2 becomes two etcetera). Negative inputs are supported, in which case the output is prefixed with "negative".

const transformation = CardinalWordsTransformation();

// 'one'
transformation.transform(1, 'en');

// 'two'
transformation.transform(2, 'en');

// 'one hundred and four'
transformation.transform(104, 'en');

// 'one thousand one hundred and thirteen'
transformation.transform(1113, 'en');
Inheritance
Available Extensions

Constructors

CardinalWordsTransformation()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transform(int input, String locale) String
Transforms input into an instance of U using the provided locale.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited