Skip to content

Commit

Permalink
Merge pull request #4461 from Santhosh-Sellavel/Espanal_Wallet_Balanc…
Browse files Browse the repository at this point in the history
…e_Translation_Fix

Wallet balance translation fix in Payments Page
  • Loading branch information
johnmlee101 authored Aug 12, 2021
2 parents b4cdc79 + c9adb5f commit daf0025
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/components/CurrentWalletBalance.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ const CurrentWalletBalance = (props) => {
);
}

const formattedBalance = Number(props.userWallet.availableBalance).toFixed(2);

const formattedBalance = props.numberFormat(
props.userWallet.availableBalance,
{style: 'currency', currency: 'USD'},
);
return (
<Text
style={[styles.textXXXLarge, styles.pv5, styles.alignSelfCenter]}
>
{`$${formattedBalance}`}
{`${formattedBalance}`}
</Text>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/libs/numberFormat/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import '@formatjs/intl-locale/polyfill';
import '@formatjs/intl-pluralrules/polyfill';
import '@formatjs/intl-numberformat/polyfill';

// Load en Locale data
// Load en & es Locale data
import '@formatjs/intl-numberformat/locale-data/en';
import '@formatjs/intl-numberformat/locale-data/es';

function numberFormat(locale, number, options) {
return new Intl.NumberFormat(locale, options).format(number);
Expand Down

0 comments on commit daf0025

Please sign in to comment.