i use a select from my database with pg-promise to send my data into a server and use this data in my web application, but the numbers coluns, like a aggregation functions are formatting as string in my server,:
Follow the code and sorry for bad english:
const pgp = require("pg-promise")();
const database = require("./DataBase");
exports.ChequeGrouped = function (cheque) {
let Select = `
SELECT
COALESCE(nome_devedor, '_TOTAL') AS nome_devedor,
CAST(SUM(valor_titulo) as numeric) AS valor_titulo,
COUNT(id_movimento_cheque) AS contagem_movimento
FROM public.__vwfw_movimento_cheque
WHERE tipo_movimento = 2
AND nome_devedor ILIKE $1
GROUP BY nome_devedor
ORDER BY nome_devedor desc `;
return database.manyOrNone(Select, cheque);
}
i receive all data as string format,