How to check if the value (not the field type) is an integer?
Options
![Nathan](https://us.v-cdn.net/6037124/user_avatars/3808629.jpg)
Nathan
Member ✭
I know about the "is_int" filter, however, the "is_int" filter checks if the field type is an integer, not the actual value.
I have my field type set to decimal because it stores both decimals and/or integers. As a result, I have no way of checking if the value itself is an integer or not because the "is_int" function always returns "false"
Tagged:
Best Answer
-
Possible solution: Create a new variable that is equal to the value you want to check and add the filter "to_int". Then do an if conditional to check if the values are the same - if they are the same then you know your original number is an integer, if they are not the same then you know your original number is a decimal.
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