document.body.innerHTML
Bunun yerine
const yenideger = shortVal(val,3,"..");

// yenidegeri göstermek istediğiniz yere yazarsınız