FdcDecimal.parseNormalized constructor

FdcDecimal.parseNormalized(
  1. String normalizedText, {
  2. required int scale,
})

Creates a decimal from a normalized numeric text using . as decimal separator. The text may be rounded to scale before storage.

Implementation

factory FdcDecimal.parseNormalized(
  String normalizedText, {
  required int scale,
}) {
  final parsed = tryParseNormalized(normalizedText, scale: scale);
  if (parsed == null) {
    throw FormatException('Invalid decimal value.', normalizedText);
  }
  return parsed;
}