86
rated 0 times
[
87]
[
1]
/ answers: 1 / hits: 21300
/ 11 Years ago, thu, november 21, 2013, 12:00:00
Can't seem to find a good answer to this question. How do I remove the last 11 digits from an int?
The id could be one or more numbers in the beginning but there will always be 11 digits following the id. There will always be an id in the beginning. {id}{11 digits}
.
var getId = function (digits) {
// Do some stuff and return id
}
getId(110000000001); // Should return 1
getId(1110000000001); // Should return 11
getId(2010000000001); // Should return 20
More From » javascript