From 56d745ea709bf00e71d96c36c5f5ae4032db3326 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:59:01 +0100 Subject: [PATCH] 4 decimal places --- src/CONST.ts | 2 +- src/libs/actions/TaxRate.ts | 2 +- src/pages/workspace/taxes/ValuePage.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 7a9f73f564f9..d109b9f76456 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -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; diff --git a/src/libs/actions/TaxRate.ts b/src/libs/actions/TaxRate.ts index 8ee20b9fed11..115c6543a216 100644 --- a/src/libs/actions/TaxRate.ts +++ b/src/libs/actions/TaxRate.ts @@ -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}%`; diff --git a/src/pages/workspace/taxes/ValuePage.tsx b/src/pages/workspace/taxes/ValuePage.tsx index 02972a6dbb38..4ec932fbcc14 100644 --- a/src/pages/workspace/taxes/ValuePage.tsx +++ b/src/pages/workspace/taxes/ValuePage.tsx @@ -44,7 +44,7 @@ function ValuePage({ const submit = useCallback( (values: FormOnyxValues) => { - updatePolicyTaxValue(policyID, taxID, values.value); + updatePolicyTaxValue(policyID, taxID, Number(values.value)); goBack(); }, [goBack, policyID, taxID],