Skip to content

Commit

Permalink
change logic around when to parse into our native formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Dec 20, 2024
1 parent 572edec commit eda7e92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ export function formatCurrency(
const currencySymbol = supportedNativeCurrencies[currency].symbol;
const [whole, fraction = ''] = numericString.split('.');

if (fraction === '') {
const numericalWholeNumber = +whole;
if (numericalWholeNumber > 0) {
// if the fraction is empty and the numeric string is less than 6 characters, we can just run it through our native currency display worklet
if (numericString.length <= 6) {
if (whole.length <= 6) {
return convertAmountToNativeDisplayWorklet(numericString, currency, false, true);
}

Expand Down

0 comments on commit eda7e92

Please sign in to comment.