How to convert floats to human-readable fractions?
- by Swaroop C H
Let's say we have 0.33, we need to output "1/3".
If we have "0.4", we need to output "2/5".
The idea is to make it human-readable to make the user understand "x parts out of y" as a better way of understanding data.
I know that percentages is a good substitute but I was wondering if there was a simple way to do this?