Removing trailing zeros from symbols

Wax's icon

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?

Max Patch
Copy patch and select New From Clipboard in Max.

Problem:

Jeremy's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

Best, Jeremy

Wax's icon

Awesome, thanks Jeremy! Exactly what I needed.