Ayrıca sorguda FORMAT(X, D) kullanabilirsiniz:
Formats the number X to a format like
'#,###,###.##', rounded to D decimal
places, and returns the result as a
string. If D is 0, the result has no
decimal point or fractional part.
mysql> SEÇ FORMAT (12332.123456, 4);
-> '12,332.1235'
mysql> SEÇ FORMAT (12332.1,4);
-> '12,332.1000'
mysql> SEÇ FORMAT (12332.2,0);
-> '12,332'
Edit:
O "the downside of using this method is that you cannot that number in your code" eklemek üzereydi, ama görünüşe göre bu, PHP 5.3 'ten başlayarak, artık NumberFormatter sınıfı parse fonksiyonu sayesinde bir sorun değildir :
NumberFormatter::parse numfmt_parse
- Bir numara ayrıştırma
Örnek
<?php
$fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL );
$num = "1.234.567,891";
echo $fmt->parse($num)."\n";
echo $fmt->parse($num, NumberFormatter::TYPE_INT32)."\n";
?>