본문 바로가기
MySql

MySQL 소수점 이하 두 자리 만 사용하도록 숫자 서식을 지정하려면 어떻게합니까?

by 베이스 공부 2020. 12. 17.
반응형

실수는 예를 들어 12.92이지만 12.9241은 아닙니다. 그렇게 할 수 있습니까?

 

해결 방법

 


$n = 1234.5678;

// Two decimal places, using '.' for the decimal separator
// and ',' for the thousands separator.
$formatted = number_format($n, 2, '.', ',');
// 1,234.57

 

참조 페이지 https://stackoverflow.com/questions/1992406

 

 

반응형

댓글