# ACOS auto rounding error

**URL:** https://community.thunkable.com/t/acos-auto-rounding-error/2784266
**Category:** Questions about Thunkable X
**Tags:** help
**Created:** [January 15, 2024, 3:48pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266 "2024-01-15T15:48:10Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 3:48pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/1 "2024-01-15T15:48:10Z")

</div>

Hey Hey Thunkable,

There seems to be slight bug with the ACOS. I have been working with other Thunkers on this for a month or so trying to find alternatives for processing accurate distance between locations.

AT first I thought the ACOS wouldnt show data mast a certain decimal point. It turns out it does and provides an amount of decimal places that would allow for accurate distance.

That being said, the software randomly rounds the ACOS. Even with no code.

Shown below.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/7/c78fc384b627e1eb8ddb08cc14838674dcfbfb84.jpeg)

It is the exact same code.

Same setup. One just rounds and the other doesnt.

I have checked the values in google sheet havesine and when it doesnt auto round, the numbers are accurate.

Thoughts?

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 4:13pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/2 "2024-01-15T16:13:19Z")

</div>

But the moment the location changes, it randomly rounds.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/b/4bea0b796380f527c3217404ee2134e25bc73de3.jpeg)

Interesting …

Red is now .000020000000

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 15, 2024, 6:47pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/3 "2024-01-15T18:47:02Z")

</div>

Seeing a screenshot and trying to understand what is causing certain things to happen is like watching an airplane fly overhead and trying to understand why the plane is losing altitude. We can only guess!

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 7:01pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/4 "2024-01-15T19:01:15Z")

</div>

I sent it over to Thunkable so they can look.

Yah

Super odd.

It randomly does it.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 15, 2024, 7:15pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/5 "2024-01-15T19:15:06Z")

</div>

> [@tatiang](#):
>
> airplane fly overhead and trying to understand why the plane is losing altitude.

at least here, we can assume it’s likely due to the pilot.

if you can provide some block examples, maybe we can help you make some assumptions here @cresto.pgaxq2

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 8:20pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/6 "2024-01-15T20:20:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/f/9fa6db15555061b63ec5a25c95317e62d6a3cec8.png)

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 8:27pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/7 "2024-01-15T20:27:01Z")

</div>

I gathered new lat and longs and replaced them. All within a couple yards.

Then it processed more digits.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/e/be734be149b3317097be1b12d04ba1799775f9d9.jpeg)

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 8:27pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/8 "2024-01-15T20:27:36Z")

</div>

Sometimes it rounds , sometimes it doesnt.

No change in code.

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 8:29pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/9 "2024-01-15T20:29:01Z")

</div>

Can the platform be caching old values to do the math?

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 15, 2024, 8:58pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/10 "2024-01-15T20:58:06Z")

</div>

> [@\[Solved\] How do I find/add Map Markers Nearest to the User (Haversine formula)](https://community.thunkable.com/t/solved-how-do-i-find-add-map-markers-nearest-to-the-user-haversine-formula/598411/10):
>
> I wanted to share a fun solultion that I created for another project [https://us-central1-scorecard-x.cloudfunctions.net/returnDistance?long1=45&lat1=-83&long2=22&lat2=-40&miles=true](https://us-central1-scorecard-x.cloudfunctions.net/returnDistance?long1=45&lat1=-83&long2=22&lat2=-40&miles=true) You can feed it the lat and long for both location 1 and 2, true/false for returning miles or KM. this will return an object that has the distance! Quick and easy. each response takes apx 44 seconds when the function is warm. If you are doing a 1 off calculation, it takes about a second. i also replicated it in c…

So, 1) I’m still not sure how to help other than to say if you run the same calculation 10 times with fixed values and get different results somethings odd

1. the thread above shares a cloudflare worker that will tell you the distance between 2 points in km or miles

Use the second link from that post.

---

<div class="post-metadata">

### Author: ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)
#### Post date: [January 15, 2024, 9:08pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/11 "2024-01-15T21:08:18Z")

</div>

Thanks for sending.

When clicked it shows this

# Error: Page not found

## The requested URL was not found on this server.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 15, 2024, 10:12pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/12 "2024-01-15T22:12:50Z")

</div>

> [@jared](#):
>
> Use the second link from that post.

👆

[https://vimeo.com/903112088](https://vimeo.com/903112088)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [April 14, 2024, 10:13pm UTC](https://community.thunkable.com/t/acos-auto-rounding-error/2784266/13 "2024-04-14T22:13:37Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
