Node.js examples for String:Format
Calculates a:b to string form
Math.ratio = function ( a, b ) { a = Number( a );/*from w w w .j a v a 2 s . c o m*/ b = Number( b ); var gcd = this.gcd( a, b ); return ( a / gcd ) + ':' + ( b / gcd ); };