Skip to content

NMA-1200 Buy Swap | Fiat decimal precision - #899

Merged
HashEngineering merged 5 commits into
feature-coinbase-integrationfrom
NMA-1200_Buy_Swap_Fiat_decimal_precision
Feb 26, 2022
Merged

HashEngineering merged 5 commits into
feature-coinbase-integrationfrom
NMA-1200_Buy_Swap_Fiat_decimal_precision

Conversation

@hadia

@hadia hadia commented Feb 23, 2022

Copy link
Copy Markdown
Contributor

The fiat values should only go out two decimals.

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Comment on lines +211 to +216
public static String getLocalCurrencySymbol(String currencyCode) {
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(getDeviceLocale());
Currency currency = Currency.getInstance(currencyCode);
numberFormat.setCurrency(currency);
return currency.getSymbol(getDeviceLocale());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be one merge conflict with Claude's PR:

It is possible for some phones to above old Locale information for certain currencies that have changed (eg Belarus).

    public static String getLocaleCurrencyCode(){
        Currency currency = Currency.getInstance(getDeviceLocale());
        String newCurrencyCode = currency.getCurrencyCode();
        if (CurrencyInfo.hasObsoleteCurrency(newCurrencyCode)) {
            newCurrencyCode = CurrencyInfo.getUpdatedCurrency(newCurrencyCode);
        }
        newCurrencyCode = CurrencyInfo.getOtherName(newCurrencyCode);
        return newCurrencyCode;
    }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried @ClaudeHangui method we need the local currency Symbol and the one claude create return code

@ClaudeHangui ClaudeHangui Feb 24, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadia you can create a data class which holds the symbol and the code, and return that in your case. The Currency class has a method to get the symbol; unless of course (like Belarus for example) this might have also changed.
@HashEngineering it's okay to use getSymbol() for all including Belarus' currency ??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadia @ClaudeHangui I suppose it is fine.

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine apart from Eric's comment

@HashEngineering
HashEngineering self-requested a review February 26, 2022 14:49
@HashEngineering
HashEngineering merged commit ac618f9 into feature-coinbase-integration Feb 26, 2022
@Syn-McJ
Syn-McJ deleted the NMA-1200_Buy_Swap_Fiat_decimal_precision branch March 16, 2022 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants