What exactly do you want in case? Do you only want it for a certain level of fraction? For example, tenths (0.0-0.9), hundreths (0.01-0.09), etc? If so, you can just multiply the input value by, say 10 for tenths (100 for hundreths), then do it as usual, then divide the resulting values by the same number.