Returning unexpected numbers from data

Grabbing numbers from my data file:

{
  "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:

8.013189e+06
7.350216e+06

Here is my template code:

{{ $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:

8013189
7350216

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

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?

Thanks @pointyfar, that works.

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