fixedLength method

String? fixedLength(
  1. int length, {
  2. String fill = "0",
  3. int fractionDigits = 0,
})

Returns a string representation of the number with a fixed length, including the decimal separator if needed.

The length parameter specifies the total length of the resulting string. The fill parameter specifies the character used to fill the remaining space. The fractionDigits parameter specifies the number of digits after the decimal point.

Implementation

String? fixedLength(int length, {String fill = "0", int fractionDigits = 0}) => this?.toStringAsFixed(fractionDigits).padLeft(length, fill);