-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hold until 2021-10-14] IOU - Unable to enter some combination of decimal numbers #5579
Comments
Triggered auto assignment to @deetergp ( |
If considered as external, this is Proposed Solution:Problem is with line 104 in IOUAmountPage.js This article shows how float works: Click here to read App/src/pages/iou/steps/IOUAmountPage.js Lines 102 to 105 in e1d0220
Here is solution: We have to fix validateAmount(amount) {
const decimalNumberRegex = new RegExp(/^\d+(,\d+)*(\.\d{0,3})?$/, 'i');
return amount === '' || (decimalNumberRegex.test(amount) && (parseFloat((amount * 100).toFixed(3)).toString().length <= CONST.IOU.AMOUNT_MAX_LENGTH)); // *** UPDATED CODE
} Note: At present I am not sure why parse float multiplied with 100 i.e. Below is screen record, It works proper after correction: WebWeb.movDesktopDesktop.movMobile WebMobile.Web.moviOSiOS.movAndroidAndroid.movI understand this bug is important to correct asap. If considered external then please message me, I will submit PR immediately. Thanks. |
@PrashantMangukiya it is because we store amounts in cents on the back end. (API reference) |
Triggered auto assignment to @puneetlath ( |
@deetergp ok go It. So it multiply with 100 is needed in this case. Also thanks for api reference link. If my solution accepted then please message me. I will submit pr soon. |
I just went on a journey into currencies and decimal places! TIL about the Chilean Unidad de Fomento which can have four decimal places (but is a non-circulating currency). @puneetlath: @PrashantMangukiya's proposal is solid 👍 |
Issue reproducible during KI retests |
Sounds good. @PrashantMangukiya I've invited you to the Upwork job! |
I have Experienced with this. |
I have invited to you on Upwork. |
@puneetlath thank you. Just submitted proposal on upwork. Kindly accept it so I can proceed to submit pr. |
@PrashantMangukiya hired! |
@puneetlath Thank you. Preparing the pr now and submit soon. |
PR for this issue is deployed to production version: 1.1.6-0 but awaiting payment label not applied to this issue. I think this may be GitHub automation glitch etc. |
Thanks @PrashantMangukiya. I updated the title manually and will pay on Oct 14 if there are no regressions. |
Issue not reproducible during KI retests (First Week) |
Whoops sorry for the delay. Created the job and invited @PrashantMangukiya. |
@puneetlath thanks for the message. I think Job for this issue was created and assigned to me before. So I think no need for new job now. You can just release payment from job assigned to me for this issue. Here is assigned job url. https://www.upwork.com/jobs/IOU-Unable-enter-some-combination-decimal-numbers-5579-Expensify_~014448c7e8eb9c5eea Thanks. |
Thanks for the clarification @PrashantMangukiya. I was moving a bit too fast 😅. Paid! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Request Money
Expected Result:
User should be able to enter any combination of decimal numbers
Actual Result:
Unable to enter decimal after 16, 17, 18, 19 which start 1,4,6,9
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.1.3-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/135196204-e369f854-5f66-4d11-af31-6938cfb07aba.mp4

Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: