format method Null safety

  1. @override
String format(
  1. Value v,
  2. Model<ProgramOperation> m
)
override

Implementation

@override
String format(Value v, Model m) {
  String s = v.internal.toRadixString(radix);
  if (_leadingZeroesOK && m.displayLeadingZeros) {
    final int digits = (m.wordSize + _bitsPerDigit - 1) ~/ _bitsPerDigit;
    final int n = digits - s.length;
    // 64 zeroes (63 would actually do):
    s = '0000000000000000000000000000000000000000000000000000000000000000'
            .substring(0, n) +
        s;
  }
  return addCommas(s, m.settings.integerModeCommas) + displayName;
}