Open IuliiaHerets opened 3 days ago
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.
@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
Edited by proposal-police: This proposal was edited at 2024-09-17 11:35:39 UTC.
Distance rate-Decimals are not supported for this currency yet entering dot is allowed
We are adding extra decimals prop here https://github.com/Expensify/App/blob/2190f6279041ed8260752294d095bbdda76faebe/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx#L93
This causes allowing one decimal to any currency.
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
Edited by proposal-police: This proposal was edited at 2024-09-17 11:38:52 UTC.
Distance rate-Decimals are not supported for this currency yet entering dot is allowed
We aren't checking if the currency supports decimals or not before passing extraDecimals={1}
.
https://github.com/Expensify/App/blob/2190f6279041ed8260752294d095bbdda76faebe/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx#L93
extraDecimals={getCurrencyDecimals(currency) ? 1 : 0}
.extraDecimals
prop and update like above of needed.AmountForm
to use it instead of CurrencyUtils.getCurrencyDecimals(currency)
if present.
https://github.com/Expensify/App/blob/d009d8ed4830c7d0562c524c991b8a688e2b4869/src/components/AmountForm.tsx#L87
Job added to Upwork: https://www.upwork.com/jobs/~021836536263898090209
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (External
)
@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!
Decimals are not supported for this currency yet entering dot is allowed
We always display one extra decimal
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
I don't see any reason why we need to add extra decimal. Let's remove this prop
Also see the same behavior on the submit expense page, we only use default decimal and don't add any extra decimal
@DylanDylann Please confirm the expect before going to proposals
How many decimals should be displayed?
@daledah Interesting point. I will review this issue today
I lean toward removing the extra decimal in the distance rate page as mentioned by @daledah
Anyway, I think we still need to confirm the expected first because the extra decimal is added a long time ago for the rate feature
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@Expensify/design @lakchote The number of decimals on the submit expense page and distance rate page is inconsistent. Is there any reason why we need to add one more extra decimal on the distance rate page? If not, should we remove extraDecimal to keep it consistent?
https://github.com/user-attachments/assets/083d78d1-35c3-43f8-b74b-520de39d17f9
I think that is on purpose, since a lot of government distance rates use three decimal places. cc @trjExpensify to fact check me there.
@shawnborton For the VND, ALL currency (there are no decimal in the submit expense page), Should we allow one decimal in the distance rate page?
@DylanDylann I have mentioned about removing that prop in my proposal. Any reason for selecting the other proposal
I lean toward removing the extra decimal in the distance rate page as mentioned by @daledah
@daledah gave a good explanation of why we should remove that prop that makes me lean toward this approach
@BhuvaneshPatil Let's discuss the expectation first, I will come back to proposals later. Thanks
What do you mean by the VND?
@shawnborton Ahhh VND is a currency, ALL also be a currency
For the VND currency and ALL currency (there are no decimal in the submit expense page), Should we allow one decimal in the distance rate page?
https://github.com/user-attachments/assets/30c82278-e269-4dc6-93d8-94d86a2449c9
Hmm honestly I have no idea. I kind of think we can just always allow three decimal places no matter what the currency is to keep things simple? But would love someone more familiar with distance rates to fact check me, cc @twisterdotcom
I think we should just allow three everywhere. That's what we do on oldDot.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.36-1 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Decimals are bit supported for this currency so user must not be allowed to enter dot.
Actual Result:
Decimals are not supported for this currency yet entering dot is displayed in distance rate page.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/77633941-6a95-4b64-8e52-d5d1b4db0737
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylann