withUnit static method

String withUnit(
  1. String moneyTxt,
  2. MoneyUnit unit
)

with unit. 拼接单位.

Implementation

static String withUnit(String moneyTxt, MoneyUnit unit) {
  switch (unit) {
    case MoneyUnit.YUAN:
      moneyTxt = yuan + moneyTxt;
      break;
    case MoneyUnit.YUAN_ZH:
      moneyTxt = moneyTxt + yuanZh;
      break;
    case MoneyUnit.DOLLAR:
      moneyTxt = dollar + moneyTxt;
      break;
    default:
      break;
  }
  return moneyTxt;
}