We now try to find the power of 10 by which we will have to multiply the decimal part to obtain our final answer
let digits = Math . pow ( 10 , k - 1 ) , i = 0 ; return ( Math . floor ( decimal_part * digits ) ) ; }