title: Angular 2+ - Parse JSON as number
body: <p>I want to place a marker on Google Maps using <a href="https://angular-maps.com/" rel="nofollow noreferrer">Angular Google Maps</a> my coordinates are from JSON file which when parses in Angular it's become a string.</p>
  
  <p>Angular Google Maps does not support string for coordinates number. So It needs to be number.</p>
  
  <p><strong>marker.json</strong></p>
  
  <pre><code>[  
     {  
        "id":"1",
        "lat":"13.751814",
        "lon":"100.501060"
     },
     {  
        "id":"2",
        "lat":"13.738445",
        "lon":"100.516805"
     },
     {  
        "id":"3",
        "lat":"13.730209",
        "lon":"100.779991"
     }
  ]
  </code></pre>
  
  <p><strong>maps.componenet.ts</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import {Http, Response} from '@angular/http';
  
  @Component({
    selector: 'app-maps',
    templateUrl: './maps.component.html',
    styleUrls: ['./maps.component.css']
  })
  export class MapsComponent implements OnInit {
  
      private data;
  
      constructor(private http:Http){
      }
  
      ngOnInit(){
        this.getData();
      }
  
      getData(){
          this.http.get('/localhost/marker.json')
              .subscribe(res =&gt; this.data = res.json());
      }
  
  }
  </code></pre>
  
  <p><strong>maps.component.html</strong></p>
  
  <pre><code>&lt;agm-map [latitude]="13.359665" [longitude]="101.035913" [zoom]="6"&gt;
      &lt;ng-container *ngFor="let list of data"&gt;
          &lt;agm-marker [latitude]="list.lat" [longitude]="list.lon"&gt;&lt;/agm-marker&gt;
      &lt;/ng-container&gt;
  &lt;/agm-map&gt;
  </code></pre>
  
  <p>I have tried using parseFloat like this  (Yes it's not working)</p>
  
  <pre><code>&lt;agm-marker [latitude]="parseFloat(list.lat)" [longitude]="parseFloat(list.lon)"&gt;&lt;/agm-marker&gt;
  </code></pre>
  
  <p>I'm thinking of using <code>parseInt</code> inside <code>maps.component.ts</code> file but I'm not sure where to put this.</p>
  
  <p>May someone helps me or guide me how to solve this.And please let me know that am I providing sufficient information or not.</p>
  
  <p>Thanks!</p>