The MySQL2
driver return DECIMAL
type as a string and formatCurrency
only is for numbers. This is the only difference with the MySQL
driver.
API and Configuration | Quickstart (sidorares.github.io)
There is no equivalent for DECIMAL
in JavaScript, depending on the database driver the value is converted into a Number
or a String
. The Number
type in JavaScript is a float and doesn’t have the same precision as the DECIMAL
type of the database have and can cause data loss, so many database drivers return the value as a string instead.