You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if I'm just missing it, so please let me know. I'd like to be able to have the number get as close as possible to what the user expects, such as 0.3333 resolving to 1/3, but then to have it also round to the nearest 1/8th or 1/16th if the guesswork didn't pan out. For example:
# Have 0.3333 return 1/3
Fractional.round_to_nearest_fraction(0.333333, "1/8").to_s(mixed_number:true)
#=> "3/8" Could this return "1/3"?
# But still have
Fractional.round_to_nearest_fraction(1100.142857142857143, "1/16").to_s(mixed_number:true)
#=> "1100 1/8" Which works great
The text was updated successfully, but these errors were encountered:
Great work on the gem, the parsing is excellent!
I'm wondering if I'm just missing it, so please let me know. I'd like to be able to have the number get as close as possible to what the user expects, such as 0.3333 resolving to 1/3, but then to have it also round to the nearest 1/8th or 1/16th if the guesswork didn't pan out. For example:
The text was updated successfully, but these errors were encountered: