Numeral.js , while less complex, was inspired by and heavily borrowed from Moment.js so if you have use momentjs before you should be familiar with this library. Numbers can be formatted to look like currency, percentages and more. How to use: numeral(1000).format('0,0') returns 1,000 numeral(1230974).format('0.0a') returns 1.2m numeral(1000.234).format('$0,0.00') returns $1,000.23 numeral(1230974).format('($ 0.00 a)') returns $ 1.23 m numeral(1).format('0%') returns 100% numeral(0.974878234).format('0.000%') returns 97.488% For more sample and options go to http://numeraljs.com/ .
I've spent hours trying to figure this out, but the solution is just adding the type="button" attribute to the button element. Issue. <button id="generateButton" class="btn btn-info btn-sm">Generate</button> Solution <button id="generateButton" type="button" class="btn btn-info btn-sm">Generate</button> I got the solution from this post on SOF. http://stackoverflow.com/questions/12325066/button-click-event-fires-when-pressing-enter-key-in-different-input-no-forms