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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -