# Convert shortcode parameters to actionable floats

**URL:** <https://discourse.gohugo.io/t/convert-shortcode-parameters-to-actionable-floats/18107>\
**Category:** support\
**Created:** [April 14, 2019, 12:47pm UTC](https://discourse.gohugo.io/t/convert-shortcode-parameters-to-actionable-floats/18107 "2019-04-14T12:47:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weru](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/weru/32/7300_2.png) [@Weru](https://discourse.gohugo.io/u/Weru)\
**Post date:** [April 14, 2019, 12:47pm UTC](https://discourse.gohugo.io/t/convert-shortcode-parameters-to-actionable-floats/18107/1 "2019-04-14T12:47:24Z")

</div>

I’m trying to do some math from a nested shortcode. My code looks like

```auto
{{ with .Parent }}
{{ $blocks := (div 12 (.Get "columns")) }}
<div class = 'column col-lg-{{ with $blocks }}{{ . }}{{ else }}12{{ end }}'>
  {{ .Inner }}
</div>
{{ end }}

```

The `columns` value would be from the parent shortcode. My code fails so far because the input value of `columns` is a string. I would like to convert it into a float that would be work with the division operation.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [April 14, 2019, 12:50pm UTC](https://discourse.gohugo.io/t/convert-shortcode-parameters-to-actionable-floats/18107/2 "2019-04-14T12:50:05Z")

</div>

You can use `float`: [https://gohugo.io/functions/float/](https://gohugo.io/functions/float/) or `int`: [https://gohugo.io/functions/int/](https://gohugo.io/functions/int/)

---

<div class="post-metadata">

**Author:** ![Weru](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/weru/32/7300_2.png) [@Weru](https://discourse.gohugo.io/u/Weru)\
**Post date:** [April 14, 2019, 1:13pm UTC](https://discourse.gohugo.io/t/convert-shortcode-parameters-to-actionable-floats/18107/3 "2019-04-14T13:13:35Z")

</div>

Thank you @pointyfar
