sorry but i dont understand.
you are dealing with doubles so why do you convert it to a int?
the best way to do it is just taking the double.
using floor to get the whole number before the decimal point and then substract the origin number with the whole number only.
as
@Jeffrey Cameron did.
if you conert to string and start spliting the string you may get errors like
if there is no point in the number or if the phone instead of dot use comma "," you may get a crash.