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

When using the cell "Edit" option to enter a number, the behaviour should be consistent with toNumber() #2163

Closed
ostephens opened this issue Sep 20, 2019 · 3 comments
Milestone

Comments

@ostephens
Copy link
Member

@ostephens ostephens commented Sep 20, 2019

Describe the bug
If you enter a string into a cell such as "3" and then use "toNumber()" to convert it to a number, toNumber() first tries to parse as a Long, and then tries parsing as a Double. So "3" will be stored as a Long, while "3.0" will be stored as a Double

However, if you edit a cell by using the single cell "edit" option and enter a number, and change the 'type' to Number, OR only attempts to parse the string typed into the cell edit dialogue as a Double - meaning that "3" is stored as a Double, not a Long. This means that entering "3" and "3.0" have exactly the same result in this case.

Expected behavior
The two options should be consistent in terms of how they parse strings to numbers and store the data.

The 'toNumber()' behaviour is preferred, and the 'edit' cell dialogue should be consistent with 'toNumber()' when entering numbers into cells

OpenRefine (please complete the following information):

  • Version 3.2

Additional context
https://groups.google.com/d/msg/openrefine/8uq_mZMISCs/E4IKWNHeBQAJ

@thadguidry
Copy link
Member

@thadguidry thadguidry commented Sep 21, 2019

I'm all for eliminating the guessing game for users. The con here is that we lose some simplicity in handling Numbers, but its inconsistent handling so... Generally, +1 on the expected behavior to favor consistent handling.

@PrzemyslawCieslik
Copy link

@PrzemyslawCieslik PrzemyslawCieslik commented Oct 2, 2019

Somebody doing this issue or can I take it?

@thadguidry
Copy link
Member

@thadguidry thadguidry commented Oct 2, 2019

go for it @PrzemyslawCieslik and you can even now do a WIP (work in progress) Draft PR in Github, so I'd suggest starting that way, so we can help along and review at same time. Here's how: https://github.blog/2019-02-14-introducing-draft-pull-requests/

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

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.