Remove last 3 characters of string or number in javascript -
i'm trying remove last 3 zeroes 1437203995000
how in javascript. im generating numbers new date() function
here approach using str.slice(0, -n)
. n number of characters want truncate.
var str = 1437203995000; str = str.tostring(); console.log("original data: ",str); str = str.slice(0, -3); str = parseint(str); console.log("after truncate: ",str);
Comments
Post a Comment