Currency.create constructor
Currency.create(})
Creates a currency with a given isoCode and decimalDigits.
- isoCode - the currency isoCode e.g. USD
- decimalDigits - the number of digits after the decimal place the the currency uses. e.g. 2 for USD as it uses cents to 2 digits.
- pattern - the default output format used when you call toString on a Money instance created with this currency. See Money.format for details on the supported patterns. groupSeparator controls the character used to separate blocks of 1000. e.g. 1,000,000. By default the groupSeparator is ',' decimalSeparator controls the character used for the decimal place. By default the decimalSeparator is '.'
Implementation
Currency.create(this.isoCode, this.decimalDigits,
{this.symbol = r'$',
this.pattern = defaultPattern,
this.groupSeparator = ',',
this.decimalSeparator = '.',
this.country = '',
this.unit = '',
this.name = ''})
: scaleFactor = Currency._calcPrecisionFactor(decimalDigits) {
if (isoCode.isEmpty) {
throw ArgumentError.value(
isoCode, 'isoCode', 'Must be a non-empty string.');
}
}