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