I think you'll find it difficult to obtain an answer other than 15 for most numerical arguments, given the rounding of doubles.
For a sensible answer, the function would require a string argument - given such, the task is reduced to counting characters following the decimal separator, after right-trimming zeros.