# Math Bug?

**URL:** <https://community.glideapps.com/t/math-bug/62993>\
**Category:** Ask for Help\
**Created:** [June 20, 2023, 9:36pm UTC](https://community.glideapps.com/t/math-bug/62993 "2023-06-20T21:36:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drascon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drascon/32/20070_2.png) [@drascon](https://community.glideapps.com/u/drascon)\
**Post date:** [June 20, 2023, 9:36pm UTC](https://community.glideapps.com/t/math-bug/62993/1 "2023-06-20T21:36:34Z")

</div>

Working on some math for my app where I’m converting pounds to kilograms then performing medication calculations (dosing and volume):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/b/8b65b863f504036306f8e2e071059acc61b6d4b4.png)  
The initial factors are the patient’s weight in pounds and the number used to perform the conversion. The patient’s weight is dynamic, based on user specific input, and the conversion is static. Note: I’ve tried both factors [\*0.454 and /2.205] and they both produce the correct weight in kgs, see below.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/9/d965a6be971cae8af1b64ae755aafae8df09cc7c.png)  
From here, I take the value from the sheet where the calculation is being performed then math it further for each specific medication:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/2/b2e047a2e9c1c1956113e607b6e2efbf2d9f3a10.png)  
The problem, however, is that the product I’m being given is 22.7:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/8/28b7637d9f58ce28a3a28062980ea52041462313.png)  
4.5 \* 5 = 22.5 not 22.7. Can someone please tell me if this is a bug or user error?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 20, 2023, 9:47pm UTC](https://community.glideapps.com/t/math-bug/62993/2 "2023-06-20T21:47:05Z")

</div>

Math uses the true underlying value. You are cutting it off at 1 decimal place, but all decimals are there underneath. You need to use a Round in your formula if you want a true rounded value.

round(lbs\*0.454, 1)

---

<div class="post-metadata">

**Author:** ![drascon](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drascon/32/20070_2.png) [@drascon](https://community.glideapps.com/u/drascon)\
**Post date:** [June 20, 2023, 9:50pm UTC](https://community.glideapps.com/t/math-bug/62993/3 "2023-06-20T21:50:21Z")

</div>

As always, @Jeff_Hager coming in clutch. File this one under “User Error” lol.

Thank you sir!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [June 21, 2023, 9:51pm UTC](https://community.glideapps.com/t/math-bug/62993/4 "2023-06-21T21:51:06Z")

</div>

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