nagymusic

Hello!
Is there a function that translates a list of fractions into a list of decimals (1/4 to 0.25) and vice versa? I know that one could construct a patch for this, but I thought it might be worth asking just in case.
Thank you!

Karim

Hi,
Certainly for the first question. Just use the float function.
Concerning the other one you can do for simple floats (not irrationals) – see screenshot
if you have for example pi (3.1415…) or 1/3 = 0.33333…. these will not render exactly as a ratio but will be approximated.
Best
K
Attachments:Screenshot_20180328_040611.png
Screenshot_20180328_040611.png

nagymusic

Thanks, Karim. I had a chance to experiment with your suggestions (see the patch attached). The conversion from fractions to decimals works great (1/4 1/8 = 0.25 0.125). While the opposite produces the desired outcome, it’s still not computing the same values (0.25 0.125 = 1/4 3/25). My goal is to be able to go back and forth by keeping the same values, e.g, 0.25 0.125 = 1/4 1/8.
I welcome your thoughts. Thank you once again!

Karim

Oh sorry
should have explained more. 0.125 have 3 decimals so instead of 100 you should use 1000
and you will get 1/8
If the decimals are finite and not endless (like dividing by 3 or 7 etc…) you just have to calculate the number of decimals and multiply by 10
Best
K
