Error when multiplying a decimal
![Paul S](https://us.v-cdn.net/6037124/uploads/userpics/3POY27PE3YRJ/nBZLOL9G694HT.png)
I get a strange error "Exception: Numbers are required for mathmatical operations."
The number I'm trying to multiply is a decimal - e.g. 0.0002312203989
Any thoughts on what the problem might be?
Best Answer
-
Ah yes I see. You are trying to multiply a list (array)
To apply transformations to a list you will need to iterate through it with a loop. You'll want to use a For Each Loop so you can update each item with your multiplication.
Answers
-
Can you check to make sure that it's not a text data type? This is a common mix-up we see
-
Thanks Michael
Yeah, I'm sure its decimal. I created a new table and api to be sure.. see below
am I doing something wrong here?
-
Aaah...i was confused because I only receive one item back, but in effect it's still a list
changed it to single and it works
thanks Michael!
-
If you just want to do it to a single record, you can either turn the return type from list to single or use a Get Record... you won't have to use a loop in that case. But lists require a loop (even if it's a list of 1)
-
Had the same exact problem but when using an aggreagte !! Very helpful
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