consider we have numbers all less than 1 like, 0.2, 0.254, 0.36847, 0.12 and so on and we want to count the number of the digits after the "dot" (.) and this yields 1, 3, 5, 2 for those double numbers in order.
How to do this?
The point is, there is no such number as ".12" inside the computer, only a very close approximation. And counting the base-10 decimal points before you get all 0's is not exactly possible. As Thomas1965 suggested, you could write out the number without padding to some arbitrary precision (say 8 decimal places) and count the number of characters that are printed out. But there is nothing intrinsic to the number that will tell you how many decimal places there are, and you will always have to deal with rounding errors when converting to/from base-10.