# How to parseInt a number that start with 0?

I have this string: `'044600171940'`.
I want to parse the string to a number with `parseInt`, but the value returns a number without the `0` in the front.

Is it possible to return the number with a leading `0` (e.g. `044600171940`)?

``````var arr = ['044600171941','044600171940'];

var last = arr[arr.length -1];
var number = parseInt(last)
console.log(number)//44600171940
``````

### >Solution :

`padStart(int, character)` fills up the start of a string until the length is `int` characters long.

``````var arr = ['044600171941','044600171940'];

var last = arr[arr.length -1];

const addToNumberString = (intStr, value) => {
let originalLength = intStr.length
let sumInt = Number(intStr) + value;
let sumIntStr = String(sumInt);

return sumIntStr.padStart(originalLength, '0');
};

console.log(addToNumberString(last, 1)) // '044600171941'``````

…and here is a solution based off the fact that the value is always 12 characters long.

``````const numberLength = 12;

const addPadding = (number) => {
return String(number).padStart(numberLength, 0);
};

var arr = ['044600171941','044600171940'];

var last = arr[arr.length -1];
var number = parseInt(last)

console.log( addPadding(17) )         // '000000000017'

console.log( addPadding(number) )     // '044600171940'

console.log( addPadding(number + 1) ) // '044600171941'``````

1. Nice