Published in


Postgres/Sequelize — returns a string for decimal/numeric type

I am not very familiar with postgres and sequelize and just realized that it would return the decimal/numeric type as string in the code.

Here I found a work around to make it returns as string in the code base, and it worked well for me.

Make this change in the model.

Do this

instead of

Please leaves comments if anyone know other better ways to handle this.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store