You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Distance rate-Decimals are not supported for this currency yet entering dot is allowed #49336
@alexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
What changes do you think we should make in order to solve the problem?
We should remove that prop or set to different value based on the decimals supported for the currency
Note : We need to check with original contributor as to why this was set to 1, based on that we can change the value.
Same can be done in this component PolicyDistanceRateEditPage
We can always find and update pages where we are using distance rate add/update functionality
case 1: CurrencyUtils.getCurrencyDecimals(currency) returns 0 then final value will be 3
case 2: CurrencyUtils.getCurrencyDecimals(currency) returns 2 then passed values will be 1, and decimals will be 3
We can update this change where we take amount input
What alternative solutions did you explore? (Optional)
changed the title [-]Distance rate-Decimals are not supported for this currency yet entering dot is allowed[/-][+][$250] Distance rate-Decimals are not supported for this currency yet entering dot is allowed[/+]on Sep 18, 2024
@DylanDylann when you get a chance, can you review the proposals to address this Albanian currency issue? Also, I'm not sure if there are other currencies that are affected by this issue like Japanese Yen. Thanks!
If currency is ALL the default decimal is 0 and the extra decimal is 1 --> we will display one decimal
If currency is USD the default decimal is 2 and the extra decimal is 1 --> we will display three decimal
What changes do you think we should make in order to solve the problem?
Add new prop to AmountForm Component called fixedDecimal. If fixedDecimal is valuable, we will use this value instead of CurrencyUtils.getCurrencyDecimals(currency) + extraDecimals
In CreateDistanceRatePage PolicyDistanceRateEditPage, PolicyDistanceRateTaxReclaimableEditPage, we need to pass fixedDecimal: 4 and remove extraDecimals prop
📣 @daledah You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
Activity
melvin-bot commentedon Sep 17, 2024
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.IuliiaHerets commentedon Sep 17, 2024
@alexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
BhuvaneshPatil commentedon Sep 17, 2024
Edited by proposal-police: This proposal was edited at 2024-09-17 11:35:39 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance rate-Decimals are not supported for this currency yet entering dot is allowed
What is the root cause of that problem?
We are adding extra decimals prop here
App/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx
Line 93 in 2190f62
This causes allowing one decimal to any currency.
What changes do you think we should make in order to solve the problem?
We should remove that prop or set to different value based on the decimals supported for the currency
Note : We need to check with original contributor as to why this was set to
1, based on that we can change the value.Same can be done in this component
PolicyDistanceRateEditPageWe can always find and update pages where we are using distance rate add/update functionality
Update -
After this comment
We shall pass this comment
TOTAL_DECIMALSis constant.Incase of
TOTAL_DECIMALS= 3case 1: CurrencyUtils.getCurrencyDecimals(currency) returns 0 then final value will be 3
case 2: CurrencyUtils.getCurrencyDecimals(currency) returns 2 then passed values will be 1, and decimals will be 3
We can update this change where we take amount input
What alternative solutions did you explore? (Optional)
Krishna2323 commentedon Sep 17, 2024
Edited by proposal-police: This proposal was edited at 2024-09-17 11:38:52 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance rate-Decimals are not supported for this currency yet entering dot is allowed
What is the root cause of that problem?
extraDecimalsprops was introduced for specific cases like tax value and distance rates.2 decimal placesbut this doesn't apply to all currencies.App/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
Lines 110 to 111 in ffeda71
App/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx
Line 93 in 2190f62
What changes do you think we should make in order to solve the problem?
extraDecimalsprop tofixedDecimals.AmountFormwe should modify the line toconst decimals = fixedDecimals ?? CurrencyUtils.getCurrencyDecimals(currency);App/src/components/AmountForm.tsx
Line 87 in ffeda71
extraDecimalsprops.4or3tofixedDecimalsprops.What alternative solutions did you explore? (Optional)
AmountFormto use it instead ofCurrencyUtils.getCurrencyDecimals(currency)if present.App/src/components/AmountForm.tsx
Line 87 in d009d8e
What alternative solutions did you explore? (Optional 2)
extraDecimals={getCurrencyDecimals(currency) ? 1 : 0}.extraDecimalsprop and update like above of needed.Result
melvin-bot commentedon Sep 18, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021836536263898090209
[-]Distance rate-Decimals are not supported for this currency yet entering dot is allowed[/-][+][$250] Distance rate-Decimals are not supported for this currency yet entering dot is allowed[/+]melvin-bot commentedon Sep 18, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)alexpensify commentedon Sep 18, 2024
@DylanDylann when you get a chance, can you review the proposals to address this Albanian currency issue? Also, I'm not sure if there are other currencies that are affected by this issue like Japanese Yen. Thanks!
daledah commentedon Sep 20, 2024
Edited by proposal-police: This proposal was edited at 2024-09-25 05:28:13 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Decimals are not supported for this currency yet entering dot is allowed
What is the root cause of that problem?
We always display one extra decimal
App/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx
Line 93 in 2190f62
If currency is ALL the default decimal is 0 and the extra decimal is 1 --> we will display one decimal
If currency is USD the default decimal is 2 and the extra decimal is 1 --> we will display three decimal
What changes do you think we should make in order to solve the problem?
Add new prop to AmountForm Component called fixedDecimal. If fixedDecimal is valuable, we will use this value instead of
CurrencyUtils.getCurrencyDecimals(currency) + extraDecimalsApp/src/components/AmountForm.tsx
Line 87 in 2190f62
In CreateDistanceRatePage PolicyDistanceRateEditPage, PolicyDistanceRateTaxReclaimableEditPage, we need to pass fixedDecimal: 4 and remove extraDecimals prop
Also need to update minimumFractionDigits: 4
App/src/libs/CurrencyUtils.ts
Line 167 in 2190f62
Also need to update here
App/src/libs/PolicyDistanceRatesUtils.ts
Line 21 in 2190f62
If we need to update the same thing across App (In money request flow) we also need to address some other instances (discuss futher)
36 remaining items
melvin-bot commentedon Sep 25, 2024
📣 @daledah You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖
daledah commentedon Sep 26, 2024
@DylanDylann PR is ready.
alexpensify commentedon Sep 27, 2024
Awesome, waiting for this one to go into Production.
alexpensify commentedon Oct 2, 2024
Automation failed but this one went into production 2 days ago
alexpensify commentedon Oct 7, 2024
Automation failed, I'll work on the payment process tomorrow.
alexpensify commentedon Oct 8, 2024
Payouts due: 10-07-2024
Upwork job is here.
alexpensify commentedon Oct 8, 2024
@daledah, please apply to the job above, and I can complete the payment process in Upwork. Thanks!
daledah commentedon Oct 9, 2024
@alexpensify Hi, can you create the offer and send to me at https://www.upwork.com/freelancers/~0138d999529f34d33f
alexpensify commentedon Oct 10, 2024
@daledah - I sent an offer via Upwork. Please accept, and then I can complete the payment process. Thanks!
daledah commentedon Oct 11, 2024
@alexpensify Accepted thx
alexpensify commentedon Oct 11, 2024
All set here, I've completed the payment for @daledah!