-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Improve number handling for amount with leading decimal point. #3096
Conversation
e.g. .47 previously resolves to 47 on csv import with .47 values. Or any other time this function is called. if the number is ,34 or .43 I would think it's clear that it is meant to be 0,34 and 0.43 respectively. however, because m.index === 0, logic called extractNumbers on '.47', outputs '47' which becomes '47.00'
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
amount
with leading decimal point.
amount
with leading decimal point.
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller
Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged No assets were unchanged |
Hi! This looks nearly the same as what I did in #3044. I don't have that extra step you added though. Is that fixing an issue you were seeing? |
Oh whoops. Glad I was at least heading in the right direction. This fixes the bug seen in 1051, but yes, duplicates your fix from #3044. I was testing on "app.actualbudget.org" and not edge, so I wasted some time here. Your fix in 3044 fixes 1051 as well. |
Fixes #1051
category: Bugfix
authors: [wdpk]
Improve number handling to handle leading decimal places.
Existing behavior:
amount = '.47'
, thenm.index ===0
so then the return call callsextractNumbers
onamount
.extractNumbers('.47')
returns47
.This PR changes the if statement so if
m.index ===0
it adds a leading 0, and then the number is correctly handled from there.