Removing trailing zeros from symbols

    Mar 13 2013 | 11:13 pm
    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?

    • Mar 14 2013 | 7:02 am
      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.
      Best, Jeremy
    • Mar 14 2013 | 4:04 pm
      Awesome, thanks Jeremy! Exactly what I needed.