# Round() function creating decimals even if places = 0

**URL:** <https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696>\
**Category:** Bugs & Issues\
**Created:** [January 17, 2024, 4:53am UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696 "2024-01-17T04:53:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 17, 2024, 4:53am UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696/1 "2024-01-17T04:53:43Z")

</div>

When using the Round() function, the result always seems to be a decimal, even if the decimal places are set to 0.

Formula:  
`Round(5.4321, 0)`

Expected Result:  
`5`

Actual Result:  
`5.0`

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 17, 2024, 8:10am UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696/2 "2024-01-17T08:10:47Z")

</div>

The round function is merely rounding the number, it does not change the display of the number, so in this case you have the result (=5) being shown with 1 decimal place.

You can change the number of decimal places to show when you configure the number field:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/7/78fa61d7916404501ff340d3d46b414c075cb24e.png)

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 19, 2024, 4:32am UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696/3 "2024-01-19T04:32:22Z")

</div>

I was trying to use it within in a formula in combination with left(), which requires an integer, so the decimal places setting doesn’t help.

> Left(“--------------------------------------------------”,50 - Round(Length(Name) \* 3.5, 0))

Would work if Round() was honoring the 0 decimal place, but I get the following error:

> “Expected argument of type ‘Integer’ but ‘Decimal’ found.”

If I use 2 separate formulas:

Name Length =

> Round(Length(Name) \* 3.5, 0)

where the decimal places is manually set to 0 like your example  
and

Separator =

> Left(“--------------------------------------------------”,50 - [Name Length])

It works, but I feel like I shouldn’t have to use 2 formulas because round() should be respecting the 0 decimal place setting that was set in the function.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 19, 2024, 7:02am UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696/4 "2024-01-19T07:02:43Z")

</div>

The round() function has to use decimal as the returned data type, since it can be used to return any number of decimal places.  
The solution is either for the left() function to accept a decimal (but cast it to integer) or for there to be a new explicit decimal-to-integer function.

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 19, 2024, 2:04pm UTC](https://community.fibery.io/t/round-function-creating-decimals-even-if-places-0/5696/5 "2024-01-19T14:04:51Z")

</div>

Thanks for the explanation @Chr1sG
