Ceil Operator alternative

HI ,

the ceil Operator similar to excel rounds the input to the next available integer(upwards)
however in excel you can choose the number or denomination you want to round up to

so in excel you can do
CEILING(4,5) = 5 round 4 to nearest 5
CEILING(6,5) = 10 round 6 to nearest 5
CEILING(11,5) = 15 round 11 to nearest 5

anyone has any alternatives to achieve the same functionality in TW ?

I believe there is a simple mathematical way to do this, that does not come to mind at this moment, something like round up, multiply by five, remove the remainder and divide by five or something similar. Just go back to basic principles, and now with 5.3.0 you can make a function operator to do it for you.

  • Will return with a solution tomorrow, if no one beats me to it.

i will check that . thanks tony for your help

In TW v5.3.0+, add the following in a tiddler with the tag $:/tags/Global

\function .ceiling(significance:"1")
[divide<significance>ceil[]multiply<significance>]
\end

Example usage:
[[11].ceiling[5]]

2 Likes

Thank you saimtiaz works great!