Reputation: 4272
This is the number:
555
I want to make it:
555000
How to do that?
This didn't work:
"" + 555 + 000
Upvotes: 0
Views: 205
Reputation: 397
Make it to string then to number :
let x = 555;
x +='000'
let y = Number(x)
Or just do the math
let x=555*1000
Upvotes: 2
Reputation: 44125
Just create a string and parse to a number:
var n = +`${555}000`;
console.log(n);
Upvotes: 1
Reputation: 1992
It's 2019 :)
console.log(`${555}000`);
Though I really encourage not to mix types.
Upvotes: 2