Problem with value type of lng/lat coordinates
Options
![Dmytro Pyatkovka](https://us.v-cdn.net/6037124/user_avatars/3939210.jpg)
Dmytro Pyatkovka
Member ✭
Hello Community,
I need your help (again 🙃).
I use the geo location point in my database.
And in API I get the following output:
{
"map_point": {
"type": "point",
"data": {
"lng": 11.24084525997,
"lat": 49.484516944722
}
}
}
I want to use the values of lng and lat in my function. In my function I expect these values to be of type decimal.
But when I check them with is_decimal I get a false.
And when I try to convert the values with to_decimal I get a 1.
How can I convert lng and lat values to decimal type?
Thanks in advance! 🙏
I need your help (again 🙃).
I use the geo location point in my database.
And in API I get the following output:
{
"map_point": {
"type": "point",
"data": {
"lng": 11.24084525997,
"lat": 49.484516944722
}
}
}
I want to use the values of lng and lat in my function. In my function I expect these values to be of type decimal.
But when I check them with is_decimal I get a false.
And when I try to convert the values with to_decimal I get a 1.
How can I convert lng and lat values to decimal type?
Thanks in advance! 🙏
Comments
-
Is it possible you are testing "map_point" rather than "map_point.data.lng"?
I was able to get decimal. I pulled a record from a table that has a geographic point on it (called "location"), and called it "restaurants_1". Then I created a variable, "longitude" and assigned it the value "restaurants_1.location.data.lng". Then I tested is_decimal on longitude - which returned true. -
Hi ,
thank you for the answer.
I have found the problem. The problem was with the array that I used in my function. 🤯
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