diff --git a/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart b/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart index 4bb76848f..88d8f4e97 100644 --- a/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart +++ b/lib/src/screens/ionia/cards/ionia_custom_redeem_page.dart @@ -117,7 +117,7 @@ class IoniaCustomRedeemPage extends BasePage { Observer(builder: (_)=> !ioniaCustomRedeemViewModel.disableRedeem ? Center( - child: Text('\$${giftCard.remainingAmount} - \$${ioniaCustomRedeemViewModel.amount} = \$${ioniaCustomRedeemViewModel.remaining} ${S.of(context).remaining}', + child: Text('\$${giftCard.remainingAmount} - \$${ioniaCustomRedeemViewModel.amount} = \$${ioniaCustomRedeemViewModel.formattedRemaining} ${S.of(context).remaining}', style: TextStyle( color: Theme.of(context).primaryTextTheme.headline.color, ),), diff --git a/lib/view_model/ionia/ionia_custom_redeem_view_model.dart b/lib/view_model/ionia/ionia_custom_redeem_view_model.dart index 88cc08e83..6bd8e15fa 100644 --- a/lib/view_model/ionia/ionia_custom_redeem_view_model.dart +++ b/lib/view_model/ionia/ionia_custom_redeem_view_model.dart @@ -16,6 +16,9 @@ abstract class IoniaCustomRedeemViewModelBase with Store { @computed double get remaining => amount <= giftCard.remainingAmount ? giftCard.remainingAmount - amount : 0; + @computed + String get formattedRemaining => remaining.toStringAsFixed(2); + @computed bool get disableRedeem => amount > giftCard.remainingAmount;