asSatsInt method

int asSatsInt()

assumes the string is already in sats.

Implementation

int asSatsInt() {
  String text = removeChars(
    split('.').first,
    chars: strings.punctuation + strings.whiteSapce,
  );
  if (text.length > 19) {
    text = text.substring(0, 19);
  }
  if (text == '') {
    return 0;
  }
  //if (int.parse(text) > 21000000000) {
  //  return 21000000000;
  //}
  return text.asInt();
}