HomeJS Add zeros for begin the number (java script) Buddhika lakshan -November 15, 2018 0 function Add_zeroes(number, length) { var my_string = '' + number; while (my_string.length < length) { my_string = '0' + my_string; } return my_string; } Tags: JS Facebook Twitter