Node.js examples for Number:Int
Formats a float number into an appropriate representation
/**/*from ww w . j a v a2s . c o m*/ * Formats a float number into an appropriate representation * of milliseconds * @param {Float} ms value to format in ms * @return {String} */ formatMs : function (ms) { if ( ms < 1000 ) { return ms.toFixed(2) + 'ms'; } else { return (ms/1000).toFixed(2)+'sec'; } }