Skip to content

Commit

Permalink
Merge pull request #39037 from software-mansion-labs/@kosmydel/tax-va…
Browse files Browse the repository at this point in the history
…lue-fix

[Taxes] Change max tax value length
  • Loading branch information
MonilBhavsar authored Mar 28, 2024
2 parents 6c95dfb + 7f2b5dd commit 8976e1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4153,6 +4153,7 @@ const CONST = {
},
},

MAX_TAX_RATE_INTEGER_PLACES: 4,
MAX_TAX_RATE_DECIMAL_PLACES: 4,
} as const;

Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/taxes/ValuePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ function ValuePage({
hideCurrencySymbol
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
// We increase the amount max length. We have to add 2 places for one digit and comma.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + 2}
// We increase the amount max length to support the extra decimals.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={<Text style={styles.iouAmountText}>%</Text>}
ref={inputCallbackRef}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ function WorkspaceCreateTaxPage({
hideCurrencySymbol
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
// We increase the amount max length. We have to add 2 places for one digit and comma.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + 2}
// We increase the amount max length to support the extra decimals.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={<Text style={styles.iouAmountText}>%</Text>}
/>
</View>
Expand Down

0 comments on commit 8976e1e

Please sign in to comment.