Check out example codes for "Numeric data type is returned as String". It will help you in understanding the concepts better.

Code Example 1

//in app.js
var types = require('pg').types
types.setTypeParser(1700, function(val) {
    return parseFloat(val);
});

Learn ReactJs, React Native from akashmittal.com