I use my AngularJS application to display Twitter account, and big account ID give me a rounded number such as :
748598350317031424 give me 748598350317031400 when displayed on page with ng-repeat.
Have you got an idea ?
I use my AngularJS application to display Twitter account, and big account ID give me a rounded number such as :
748598350317031424 give me 748598350317031400 when displayed on page with ng-repeat.
Have you got an idea ?
This occurs due to javascript JSON roundup. When id is set to 748598350317031424
, it actually assigned to the nearest representable double-precision value, which is 748598350317031400
. Because Numbers in ECMAScript are internally represented double-precision floating point.
check this for the details.
I once stuck in a situation like that and what I did was something that I'm not proud of. But you can send XMLHttpRequest
that responseType='text'
(check this) which will return the whole json response as string. now since the id comes as string value json roundup will not occur. then you can split the json by property name and get the value. As i said before this is not the best way to do this. But I'm hoping this will useful to someone.