- I was getting this error in the console.
core.js:6014 ERROR SyntaxError: Unexpected number in JSON at position 2
at JSON.parse (<anonymous>)
at SafeSubscriber.httpObj.userService.getTaxRate.subscribe.httpObj [as _next] (geotax.component.ts:404)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:183)
at SafeSubscriber.next (Subscriber.js:122)
at Subscriber._next (Subscriber.js:72)
at Subscriber.next (Subscriber.js:49)
at MapSubscriber._next (map.js:35)
at MapSubscriber.next (Subscriber.js:49)
at FilterSubscriber._next (filter.js:33)
at FilterSubscriber.next (Subscriber.js:49)
- When i debug the code i found out that this was coming because the
sevice which was returning a latitude, was appending 0 at the start .
Example latitude = "-048.55" instead of latitude="-48.55".
- How can i remove this '0' at the start of this latitude?