Implement CEILING and FLOOR functions.

Note that Google Spreadsheets accept one more parameter.

Comments

infojunkie’s picture

Title: Implement CEILING and Floor » Implement CEILING and FLOOR
infojunkie’s picture

Status: Active » Fixed

Committed the implementation to the functions:

CEILING(value, [significance])
Rounds the given number up to the nearest integer or multiple of significance. Significance is the value to whose multiple of ten the value is to be rounded up (.01, .1, 1, 10, etc.)

FLOOR(value, [significance])
Rounds the given number down to the nearest multiple of significance. Significance is the value to whose multiple of ten the number is to be rounded down (.01, .1, 1, 10, etc.)

Test spreadsheet is accessible on Google Docs. It shows a few test cases for which Google Docs outputs certain trusted values. Importing this document into a new Sheetnode via Sheetnode Google Import (node/add/googlesheet) shows that SocialCalc also outputs the same values.

Although the documentation of Google Spreadsheet CEILING and FLOOR functions mentions the third parameter, it is not supported in the actual spreadsheet, as exemplified in the same spreadsheet above, in cells A12 and C12. The third parameter causes an #N/A error with message

Wrong number of arguments to CEILING

Status: Fixed » Closed (fixed)
Issue tags: -r1.5

Automatically closed -- issue fixed for 2 weeks with no activity.