I\'d like to know if exists some function to automatically format a number by it\'s decimal, so if I have:
I actually think that your workaround is as good as any. It's simple and clear, and there's really no point talking about performance here, so just go for it.