-
Notifications
You must be signed in to change notification settings - Fork 42
Handle parsing of % character in a float type #19
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
Conversation
Apparently QuickBooks can sometimes return an actual `%` in a percentage field (e.g. "18.0%"). While this is in no way a reasonable float value whatsoever, I guess we should probably not throw an exception when confronted by the capricious whimsies of Intuit data formats.
|
It may also be worth mentioning that at first I tried adding a response fixture to the xml files contained in /spec/support, but they appear to no longer be used (and the rspec tests using them appear to be no longer working). |
|
Also the tests pass when run locally, but it looks like the Travis builds are failing when trying to bundle.
|
|
@jhmoore whats the status of https://www.pivotaltracker.com/story/show/126143139 |
|
This is causing build failures due to an unrelated issue (though one that was exposed by your changes). Looks like some time zone issue. |
|
@JasonBarnabe it looks like current master for this is green - do you know when this fix will be released as a new gem version? Thanks! // cc@bobbby1190 @jhmoore |
|
@JasonBarnabe any update on this? // cc @bobby1190 @jhmoore |
|
If you have used or tested the current master and it works, please comment in #22. I have not personally had a chance to test it yet. |
|
@JasonBarnabe we haven't used master since it hasn't been published yet (for various reasons we can't point to the sha, we need the published version). Per #22, will there be no release until you hear from people who have used it? |
|
There will be no release until it's tested. Whether it's by me or someone else. |
|
Hi @JasonBarnabe, checking in again to see if there are any plans to release the master version as part of the gem? Thanks! |
|
@JasonBarnabe looks like we're going to fork qbxml to get this fix out for one of our customers. We'll let you know when its in production so that you can release it if desired. |
|
Yes, I'd be happy to release once I hear it's working properly in the real world. |
We've encountered a couple cases where a customer's Item query can come back with a string containing an actual
%character in a percentage field, which is specified as a float type.Passing a value of
"18.0%"toFloat()blows up with a (technically very correct) exception ofArgumentError: invalid value for Float(): "18.0%".Using
"18.0%".to_finstead simply stops parsing when it encounters a non-valid character, and returns18.0.