문제

I have a table "detail" with column "amount". I would like to add thousand separator comma to the value in "amount" column and limit to 2 decimal. For instance: 20123.45323 will be 20,123.45.

How can I do it? Thanks.

도움이 되었습니까?

해결책

Use the Format function in MySQL. It would look like this:

SELECT FORMAT(amount, 2) FROM detail;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top