Select int as currency or convert int to currency format in MySql? To convert int to current format, use CONCAT() with FORMAT() function from MySQL.
you need to cast it because you are concatenating a string into a decimal data type. If you are working on it on the application level, you can add extra column which is not processed, ex. SELECT PayerDate, '$' + CAST(PaymentAmount AS VARCHAR(15)) StrPaymentAmount, PaymentAmount FROM Payments .
FORMAT() function: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_format
SELECT CONCAT('$', FORMAT(val, 2)) ... ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With