Forum Discussion
4 Replies
- jcorneliusNew Contributor III
text1 = “000000000”; //length you want
text2 = “1234”;
result = “000000000”.concat(text2);
0000000001234
//returns last number of characters
let result2 = result.slice(-9); //length you want000001234
‘0’.repeat(9).concat(text2).slice(-9)
- PakhiNew Contributor III
$value.toString().length < 9? ‘0’.repeat(9 - $value.toString().length) +$value: $value
This is working
- jcorneliusNew Contributor III
use .concat(‘00000000’).concat($Input).slice(-8)
- PakhiNew Contributor III
This is not working. Can you explain little more
$value : 1234
I want it as 000001234$value : 12345
I want it as 000012345total length = 9