ceil
ReQL command: ceil
Command syntax
r.ceil(number) → number number.ceil() → number
Description
Rounds the given value up, returning the smallest integer value greater than or equal to the given value (the value’s ceiling).
Example: Return the ceiling of 12.345.
r.ceil(12.345).run(conn, callback); // Result passed to callback 13.0
The ceil
command can also be chained after an expression.
Example: Return the ceiling of -12.345.
r.expr(-12.345).ceil().run(conn, callback); // Result passed to callback -12.0
Example: Return Iron Man’s weight, rounded up with ceil
.
r.table('superheroes').get('ironman')('weight').ceil().run(conn, callback);
Related commands
Get more help
Couldn't find what you were looking for?
- Ask a question on Stack Overflow
- Chat with us and our community on Slack
- Talk to the team on IRC on #rethinkdb@freenode.net — via Webchat
- Ping @rethinkdb on Twitter
- Post an issue on the documentation issue tracker on GitHub
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/javascript/ceil/