Skip to content
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

allow removal of thousands separator #144

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

gbass84
Copy link

@gbass84 gbass84 commented Oct 21, 2014

I thought it would be nice to allow a setting to remove the thousands separator on blur. I added it to the settings with default to "thousandsStay: true" and to the blurEvent function to string replacement.

I'm using intelliJ Idea, and it reformatted some indentation, so I apologize for the diff showing more changes than there really are.

Nannoises and others added 3 commits October 21, 2014 11:56
Set default prefix to "US$ " and default affixStay to "false".  Added thousandsStay setting with default value of "false".
@Nannoises
Copy link

I just forked this repository to make this same change for my own purposes. Definitely seems like a useful feature so that decimal values can be parsed from masked fields.

@gbass84
Copy link
Author

gbass84 commented Oct 21, 2014

I'm not sure why it's saying that the change event isn't firing, btw. I reviewed the code and it looks fine. The logic for the input.change() is preserved....

Changed prefix, affixesStay, and thousandsStay default values from
personalized to more general purpose settings.
@Nannoises
Copy link

I'm not sure either, I've created a pull request for my similar solution to see if the tests pass.

@gbass84
Copy link
Author

gbass84 commented Oct 21, 2014

That did make it pass, but I'm not all that happy about setting and reading from the input twice. This solution does it a maximum of twice, I believe yours does it 2-3 times (1 is extraneous I think), but really it should only need to be done once. I'm still not sure what was causing the single access method to fail though.

@Nannoises
Copy link

My solution will only read and set from the input once, even if both affixStay and thousandsStay are set to false.

@gbass84
Copy link
Author

gbass84 commented Oct 22, 2014

excellent, i may have misread then! I was pretty sure that I could make it work with one, but I haven't figured out how to send something to CI without committing, which is really annoying. Isn't there a "run all tests" feature?

@Nannoises
Copy link

I didn't try running the tests locally, I just committed and the tests were run. Open the /test/index.html file in a browser though, and it should run your tests and display the results. Neatly done!

@gbass84
Copy link
Author

gbass84 commented Oct 22, 2014

Nice, good to know. I was trying to use github as editor and VCS, instead of using git as version control, and I think that was a source of many problems. I'm actually setting up git in my IDE so I can just import projects and work on them as intended.

I went back and looked at your fix again and I think I was reading the diffs wrong, the colors came out better on the second computer I used and made it clear what I was reading wrong.

This pull request can be closed, please merge #146
EDIT: Further testing revealed inadequate functionality, updated below

@gbass84
Copy link
Author

gbass84 commented Oct 22, 2014

Ok, this it. Works as intended, one read and one write, now works to remove multiple separators for numbers over 999,999.99

@plentz plentz added the feature label Oct 22, 2014
@Nannoises
Copy link

Good catch!

@Nannoises
Copy link

@gbass84 , did you see my pull request to your repo? Was hoping we could merge our efforts.

@gbass84
Copy link
Author

gbass84 commented Oct 30, 2014

I didn't until now, sorry. I'll get it merged tonight.

@gbass84
Copy link
Author

gbass84 commented Nov 19, 2014

btw, when I reproduce the tests in alive environment on my machine, the test scenarios past. I'm not on my normal dev machine now to check the tests in the browser, but it might be that the test need to be fixed/changed, because I can definitely successfully unmask a negative 0-precision value with a prefix and suffix

@Nannoises
Copy link

Yea the automatic testing server is inconsistent and sometimes fails when the build will pass locally. Makes it difficult to see if there are real problems.

@plentz
Copy link
Owner

plentz commented Feb 27, 2015

@Nannoises @gbass84 sorry for taking so long to reply guys. we need to fix the tests before this get merged. I will try to take a look at this tomorrow :)

@plentz
Copy link
Owner

plentz commented Feb 28, 2015

Another thing that would be super awesome is to squash your commits(making the 21 commits into one). It's better for the repo history :)

@plentz
Copy link
Owner

plentz commented Mar 8, 2015

don't forget me 😿

@Nannoises
Copy link

Since we pooled our efforts into this pull request from @gbass84 , I believe he will need to do the squashing. Let me know if I can help.

@Nannoises
Copy link

Out of curiosity I went looking for how to do this. @gbass84 Will need to follow these instructions to update his pull request. http://eli.thegreenplace.net/2014/02/19/squashing-github-pull-requests-into-a-single-commit

@gbass84
Copy link
Author

gbass84 commented Mar 10, 2015

Yeah I'll get it done in the next day or two tops!
On Mar 10, 2015 7:28 AM, Matt [email protected] wrote:Since we pooled our efforts into this pull request from @gbass84 , I believe he will need to do the squashing. Let me know if I can help.

—Reply to this email directly or view it on GitHub.

@gbass84
Copy link
Author

gbass84 commented Jun 23, 2015

This brings it back to last the last good build related to this branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants