divide + ceil = 81.1 ??
Options
![Thierry MARTIN](https://us.v-cdn.net/6037124/user_avatars/2208966.jpg)
Thierry MARTIN
Member ✭
Hi guys,
I'm quite confused with the ceil filter. It's supposed to round a decimal up to the next integer, but in my case, it doesn't. 🤷♂️
[image.png]
"total_pages" is initialized with the the value of the key "count" in the input "folder" (json). In this case, it's 811.
When I divide total_pages by 10 (the value of the per_page input) and add the ceil filter (plus a to_int), the value of total_pages becomes 81.1 😅
I've probably missed something, but what?
I'm quite confused with the ceil filter. It's supposed to round a decimal up to the next integer, but in my case, it doesn't. 🤷♂️
[image.png]
"total_pages" is initialized with the the value of the key "count" in the input "folder" (json). In this case, it's 811.
When I divide total_pages by 10 (the value of the per_page input) and add the ceil filter (plus a to_int), the value of total_pages becomes 81.1 😅
I've probably missed something, but what?
Comments
-
It sounds like you might be applying the ceiling filter to the value of 10, which you are dividing by instead of the result, which is now going to be the variable total_pages...
You can always divide within filters (you don't need the function) so that you could do this all in 1 line on the function stack versus multiple.... it could look like this:
[CleanShot 2021-11-03 at 11.53.14.png]
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback