Removing trailing zeros from symbols
How do I remove trailing zeros that sprintf is generating from ints going to symbols? Probably really simple, just never needed to know. I already searched, and couldn't find the answer.
0.29 becomes 0.290000
I want to remove the last four zeros but keep it a symbol. regexp?
Problem:
Try the attached. The solution on the left won't work for all numbers (very small numbers will be displayed in exponential notation), but for most in the range you'll be using for display in Max, it should be fine. The solution on the right should work for all numbers, but is certainly a little slower.
http://stackoverflow.com/questions/2411903/getting-printf-to-drop-the-trailing-0-of-values
http://stackoverflow.com/questions/1863602/floating-point-formatting-in-printf
http://www.manpagez.com/man/3/printf/
Best, Jeremy
Awesome, thanks Jeremy! Exactly what I needed.