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

fix CEILING behavior for values of "significance" that are not powers… #63

Merged
merged 1 commit into from
Sep 6, 2018

Conversation

patriciali
Copy link
Contributor

… of 10

previously, the implementation of CEILING would return 0.3 for CEILING(0.19, 0.25), and 0.8 for CEILING(0.69, 0.25), due to the rounding logic, which doesn't work when significance is not a power of 10.

Google Sheets's implementation does this correctly, and even calls it out explicitly that they handle this:

CEILING is most often used with factor set to a 'round' number such as 0.1 or 0.01 in order to round to a particular decimal place. However, factor can, in fact, be any number of the same sign as value, e.g. CEILING(23.25,0.18) which results in 23.4, which is 0.18 * 130. This can be used, for instance, to round up to a particular denomination of currency (e.g. 0.25 or 0.05 USD).

(see https://support.google.com/docs/answer/3093471?hl=en)

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

Successfully merging this pull request may close these issues.

2 participants