Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Changing decimal values to fractions

$
0
0

Does anyone know of a good way to convert decimal values to fractions for use in inch measurements? I have a script that works great but it returns values like 5.5638 and I'd rather it return the closest fraction answer like 5 9/16. 1/16ths would be great, but I'd settle for 1/8ths.

 

I started trying to come up with a large if with lots of > and < conditions, but I figured if anyone has already done this it might be better not to reinvent the wheel.

 

Thanks.


Viewing all articles
Browse latest Browse all 12845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>