Is there a format for numeral.js that will show decimals only when needed?
Yes. Put the optional decimals in brackets:
numeral(1234).format('0,0.[00]');
// output: 1,234
numeral(1234.567).format('0,0.[00]');
// output: 1,234.57
Either no decimals or 2 decimals:
numeral(1234).format('0,0[.]00');
// output: 1,234
numeral(1234.5).format('0,0[.]00');
// output: 1,234.50
(Based on johnwp's comment from the accepted answer).