@@ -88,7 +88,7 @@ public class CreateTransferFragment extends Fragment {
8888 private static final String ELLIPSIS = "..." ;
8989 private static final int NOTES_MAX_LINE_LENGTH = 40 ;
9090 private static final String REGEX_ONLY_NUMBER = "[^0-9]" ;
91- private static final String REGEX_REMOVE_TRAILING_EMPTY_SPACE = "\\ s+$" ;
91+ private static final String REGEX_REMOVE_EMPTY_SPACE = "^ \\ s+| \\ s+$" ;
9292 public static final String REGEX_ONLY_NUMBER_AND_DECIMAL = "[^0-9.]" ;
9393 private static final String US_CURRENCY_CODE = "USD" ;
9494 private static final String CURRENCY_FILE_NAME = "currency.json" ;
@@ -593,8 +593,10 @@ private void registerAvailableFundsObserver() {
593593 public void onChanged (final Transfer transfer ) {
594594 if (transfer != null ) {
595595 CurrencyDetails currencyDetails = getNumberOfFractionDigits (mCurrencyCode );
596- String summary = requireContext ().getString (R .string .mobileAvailableBalance ,currencyDetails == null ? "" : currencyDetails .getSymbol (),
597- formattedAmount (stringToDouble (transfer .getDestinationAmount ()),mCurrencyCode ), transfer .getDestinationCurrency ());
596+ String summary = requireContext ().getString (R .string .mobileAvailableBalance ,
597+ currencyDetails == null ? "" : currencyDetails .getSymbol (),
598+ formattedAmount (stringToDouble (transfer .getDestinationAmount ()), mCurrencyCode ),
599+ transfer .getDestinationCurrency ());
598600 mTransferAllFundsSummary .setText (summary );
599601 mTransferAllFundsSummary .setVisibility (View .VISIBLE );
600602 if (mCreateTransferViewModel .isUpdateTransferAllFunds ()) {
@@ -742,7 +744,7 @@ private String formattedAmount(final double amount, final String currencyCode) {
742744 mGroupSeparator = Character .toString (decimalFormatSymbols .getGroupingSeparator ());
743745 mCreateTransferViewModel .setDecimalSeparator (mDecimalSeparator );
744746 mCreateTransferViewModel .setGroupSeparator (mGroupSeparator );
745- return currencyFormatter .format (amount ).replaceAll (REGEX_REMOVE_TRAILING_EMPTY_SPACE , EMPTY_STRING );
747+ return currencyFormatter .format (amount ).replaceAll (REGEX_REMOVE_EMPTY_SPACE , EMPTY_STRING );
746748 }
747749
748750 private double stringToDouble (@ NonNull final String amount ) {
0 commit comments