Format numbers in Javascript
A quick and useful JavaScript function to display numbers with a fixed number of decimal places. The default number of places can be set by changing the value of the defaultPlaces variable. In the example above it is set to 2 places. Calling the function showAsFloat(65.267) would return 65.27 The number of places can be […]