I am getting an 20 digit number from API call. I want to retain the number as it is in javascript. How can I achieve this? For Eg : Response from API is 123456789123456789. I want to convert this to string or retain it as number(if its possible) in javascript. Result desired "123456789123456789".
Asked
Active
Viewed 708 times
0
-
1""+ number ;) ;) – Suresh Atta Apr 25 '17 at 04:20
-
1Possible duplicate of [How can I handle numbers bigger than 17-digits in Firefox/IE7?](http://stackoverflow.com/questions/1086575/how-can-i-handle-numbers-bigger-than-17-digits-in-firefox-ie7) – Koby Douek Apr 25 '17 at 04:20
-
1. Add some code. 2. How do you get the number from the "API call"? – Amin Negm-Awad Apr 25 '17 at 06:17
1 Answers
0
Assuming your API call function name is myAPICall
:
var result = myAPICall() + "";

Webeng
- 7,050
- 4
- 31
- 59