<p>While working on a project, I came across a JS-script created by a former employee that basically creates a report in the form of</p>

<pre><code>Name : Value
Name2 : Value2
</code></pre>

<p>etc.</p>

<p>The peoblem is that the values can sometimes be floats (with different precision), integers, or even in the form <code>2.20011E+17</code>. What I want to output are pure integers. I don't know a lot of JavaScript, though.  How would I go about writing a method that takes these sometimes-floats and makes them integers?</p>

You can use
Math.round()
for rounding numbers to the nearest integer.
```
```
Math.round(532.24) => 532
```
```
Also, you can use
parseInt()
and
parseFloat()
to cast a variable to a certain type, in this case integer and floating point.