displayAmount method

String displayAmount()

Implementation

String displayAmount() {
  double totalAmount = medicineController.cartTotalAmount.value;
  if (totalAmount == totalAmount.roundToDouble()) {
    return totalAmount.toInt().toString();
  } else {
    return totalAmount.toStringAsFixed(2);
  }
}