Friday, 6 September 2013

issue in changing string to number in javascript

issue in changing string to number in javascript

i have a string and i want to change it to number in javascript.
console.log(this.CountModel.get("count"));
var totalPages = parseInt(Math.ceil(this.CountModel.get("count") /
numPerPage));
console.log(totalPages);
I used parsint but did not work. The first console return 200 which is
right and the next console returns NAN. But how can I get the totalpages
in number?
Thanks

No comments:

Post a Comment