format method

  1. @override
String format({
  1. bool compact = false,
  2. String decimalDelimiter = '.',
  3. bool thousands = true,
  4. String thousandsDelimiter = ',',
  5. bool decimal = true,
})
override

Formats this decimal to a String.

  • If compact is true it will format as compactedPrecision instance.
  • If thousands is true it will use thousands delimiters for the wholePart.
  • If decimal is true it will add the decimalPartAsString to the String result.
  • decimalDelimiter is the delimiter for the decimal part.
  • thousandsDelimiter is the thousands delimiter.

Implementation

@override
String format(
    {bool compact = false,
    String decimalDelimiter = '.',
    bool thousands = true,
    String thousandsDelimiter = ',',
    bool decimal = true}) {
  var self = this;
  if (compact) {
    self = self.compactedPrecision;
  }
  return self._formatImpl(
      thousands, thousandsDelimiter, decimalDelimiter, decimal);
}