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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -