code: function parseCurrencyText(text) {
    let amount = Number(text.replace(/[^0-9.]+/g, ''));
    if (text.indexOf('DR') > -1) {
      amount = -amount;
    }
    return amount;
  }
docs: parse the balance to a double number. e.g. '$1,766.50 CR', '$123.00 DR' Positive is CR, and negative is DR.