floor
ReQL command: floor
Command syntax
r.floor(number) → number number.floor() → number
Description
Rounds the given value down, returning the largest integer value less than or equal to the given value (the value’s floor).
Example: Return the floor of 12.345.
> r.floor(12.345).run(conn) 12.0
The floor
command can also be chained after an expression.
Example: Return the floor of -12.345.
> r.expr(-12.345).floor().run(conn) -13.0
Example: Return Iron Man’s weight, rounded down with floor
.
r.table('superheroes').get('ironman')['weight'].floor().run(conn)
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/ruby/floor/