Skip to content

Commit

Permalink
4 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Mar 25, 2024
1 parent b31b532 commit 56d745e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4150,7 +4150,7 @@ const CONST = {
},
},

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

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/TaxRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ function deletePolicyTaxes(policyID: string, taxesToDelete: string[]) {
API.write(WRITE_COMMANDS.DELETE_POLICY_TAXES, parameters, onyxData);
}

function updatePolicyTaxValue(policyID: string, taxID: string, taxValue: string) {
function updatePolicyTaxValue(policyID: string, taxID: string, taxValue: number) {
const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
const originalTaxRate = {...policy?.taxRates?.taxes[taxID]};
const stringTaxValue = `${taxValue}%`;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/taxes/ValuePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ValuePage({

const submit = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_TAX_VALUE_FORM>) => {
updatePolicyTaxValue(policyID, taxID, values.value);
updatePolicyTaxValue(policyID, taxID, Number(values.value));
goBack();
},
[goBack, policyID, taxID],
Expand Down

0 comments on commit 56d745e

Please sign in to comment.