As title states, if I have a float, I need to get the fraction part as an integer, how do I do it?
I was thinking:
- get index(position) of decimal point
- then I can know how many digits after decimal point
- get those digits as substring
- convert it to an integer
is there any better/smarter way?
update:
I forgot to mention, the float has format like: X.YZ so there are at most two digits after decimal point.