# Formula Width Percentage

**URL:** <https://community.weweb.io/t/formula-width-percentage/2515>\
**Category:** How do I?\
**Created:** [April 28, 2023, 10:44pm UTC](https://community.weweb.io/t/formula-width-percentage/2515 "2023-04-28T22:44:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuildLikePeter](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/buildlikepeter/32/2674_2.png) [@BuildLikePeter](https://community.weweb.io/u/BuildLikePeter)\
**Post date:** [April 28, 2023, 10:44pm UTC](https://community.weweb.io/t/formula-width-percentage/2515/1 "2023-04-28T22:44:55Z")

</div>

I would like to set the width of an element with a formula. How do I specify the output of the formula as a percentage?

---

<div class="post-metadata">

**Author:** ![raydeck](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raydeck/32/384_2.png) [@raydeck](https://community.weweb.io/u/raydeck)\
**Post date:** [April 29, 2023, 12:08am UTC](https://community.weweb.io/t/formula-width-percentage/2515/2 "2023-04-29T00:08:38Z")

</div>

You might try adding to the end of your formula:

```auto
+ "%"

```

So your formula might be

```auto
(1 / countofcolumns) * 100 + "%"

```

Note that a fraction needs to be multiplied by 100 if you want it to be a percentage.

In javascript (and formulas are just wrapped javascript" you can concatenate strings using the addition (+) operator, and adding a number plus a string generates a string made of each.

---

<div class="post-metadata">

**Author:** ![BuildLikePeter](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/buildlikepeter/32/2674_2.png) [@BuildLikePeter](https://community.weweb.io/u/BuildLikePeter)\
**Post date:** [April 29, 2023, 12:11am UTC](https://community.weweb.io/t/formula-width-percentage/2515/3 "2023-04-29T00:11:55Z")

</div>

Worked great. Thank you!

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [May 2, 2023, 9:51am UTC](https://community.weweb.io/t/formula-width-percentage/2515/4 "2023-05-02T09:51:05Z")

</div>

You could also use the `concatenate` nocode formula, but @raydeck’s answer also works 😉

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [May 2, 2023, 9:51am UTC](https://community.weweb.io/t/formula-width-percentage/2515/5 "2023-05-02T09:51:10Z")

</div>


