Skip to content

Commit

Permalink
fix: using short display function
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Nov 15, 2024
1 parent 1378eca commit ae29f3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/CurrencyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function convertToFrontendAmountAsString(amountAsInt: number | null | undefined,
* @param amountInCents – should be an integer. Anything after a decimal place will be dropped.
* @param currency - IOU currency
*/
function convertToDisplayString(amountInCents = 0, currency: string = CONST.CURRENCY.USD, decimals = getCurrencyDecimals(currency)): string {
function convertToDisplayString(amountInCents = 0, currency: string = CONST.CURRENCY.USD): string {
const convertedAmount = convertToFrontendAmountAsInteger(amountInCents, currency);
/**
* Fallback currency to USD if it empty string or undefined
Expand All @@ -127,7 +127,7 @@ function convertToDisplayString(amountInCents = 0, currency: string = CONST.CURR

// We are forcing the number of decimals because we override the default number of decimals in the backend for some currencies
// See: https://github.com/Expensify/PHP-Libs/pull/834
minimumFractionDigits: decimals,
minimumFractionDigits: getCurrencyDecimals(currency),
// For currencies that have decimal places > 2, floor to 2 instead as we don't support more than 2 decimal places.
maximumFractionDigits: 2,
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/expensifyCard/WorkspaceCardListRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function WorkspaceCardListRow({limit, cardholder, lastFourPAN, name, currency, i
numberOfLines={1}
style={[styles.textNormalThemeText]}
>
{CurrencyUtils.convertToDisplayString(limit, currency, 0)}
{CurrencyUtils.convertToShortDisplayString(limit, currency)}
</Text>
{shouldUseNarrowLayout && (
<Text
Expand Down

0 comments on commit ae29f3a

Please sign in to comment.