Node.js examples for Number:Format
Serialization functions for the Number datatype
/**//from w ww .j av a 2s . c o m * Serialization functions for the Number datatype. */ Number.prototype.serialize = function() { if ( this % 1 != 0 ) // Very crude way of determining type. May be mismatch at server. { return '<double>' + this + '</double>'; } else { return '<i4>' + this + '</i4>'; } }