# Returning unexpected numbers from data

**URL:** <https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397>\
**Category:** support\
**Created:** [August 6, 2020, 3:45pm UTC](https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397 "2020-08-06T15:45:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradbice](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bradbice/32/14162_2.png) [@bradbice](https://discourse.gohugo.io/u/bradbice)\
**Post date:** [August 6, 2020, 3:45pm UTC](https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397/1 "2020-08-06T15:45:28Z")

</div>

Grabbing numbers from my data file:

```auto
{
  "months": {
    "2020-03-01": {
      "1": {
        "browser": "Chrome Mobile 80.0",
        "os": "Android 9",
        "visits": 8013189,
        "percentage": 0.235,
        "device": "Mobile"
      },
      "2": {
        "browser": "Safari 13.0",
        "os": "iOS 13.3",
        "visits": 7350216,
        "percentage": 0.216,
        "device": "Mobile"
      }
    }
  }
}

```

…returns an unexpected set:

```auto
8.013189e+06
7.350216e+06

```

Here is my template code:

```auto
{{ $data := $.Site.Data.browsers.months }}
{{ range $data }} 
<ul>
{{ range $key, $value := . }}
<li>{{ $value.visits }}</li>
{{ end }}
</ul>
{{ end }}

```

Why am I not instead getting the actual number values, like:

```auto
8013189
7350216

```

Using `Hugo Static Site Generator v0.74.2/extended darwin/amd64`

---

<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:** [August 8, 2020, 2:54am UTC](https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397/2 "2020-08-08T02:54:41Z")

</div>

When I try `{{ printf "%#T" $value.visits }}` I get `float64`. If you know that the value is an integer, you could do `{{ int $value.visits }}` maybe?

---

<div class="post-metadata">

**Author:** ![bradbice](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bradbice/32/14162_2.png) [@bradbice](https://discourse.gohugo.io/u/bradbice)\
**Post date:** [August 11, 2020, 5:39pm UTC](https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397/3 "2020-08-11T17:39:47Z")

</div>

Thanks @pointyfar, that works.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [August 13, 2020, 5:40pm UTC](https://discourse.gohugo.io/t/returning-unexpected-numbers-from-data/27397/4 "2020-08-13T17:40:01Z")

</div>

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