title: How to convert the result of an array to Int?
body: <p>I am building an app with Ionic and Firebase. I am having numbers with decimals sometimes and I would like to truncate them as integer.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>var visitMaster = [0, 0, 0, 0, 0, 0, 0];
  
          $timeout(function(){
  
            var visitRef = firebase.database().ref('/business/' + myId + '/visits/');
  
            // LAST HOUR
            visitRef.orderByChild("visit").startAt(nowMinusOne).endAt(now).once("value", function(snapshot) {
            var visitOneHour = (snapshot.numChildren() / 2);
            if (visitOneHour === ""){
            visitMaster.splice(6, 1, 0);
          } else {
            visitMaster.splice(6, 1, visitOneHour);
          }
            });
  </code></pre>
  
  <p>How to render the numbers in my <strong>visitMaster</strong> as <strong>int</strong> ?</p>
  
  <p><strong>UPDATE</strong> : each value of the array is supposed to go in a chart (bar) and so I display it that way :</p>
  
  <pre><code>//WE PUT IT IN THE CHART:
          $scope.labels = ["H-6", "H-5", "H-4", "H-3", "H-2", "H-1", "Now"];
          $scope.data = [
            visitMaster,
  
          ];
  </code></pre>
  
  <p>I would like that each value be an integer (most of them are x.5)</p>