how to format number with "." as thousand separator, and "," as decimal separator in MySql?
I'm using Format
function like
SELECT Format(myNumber,2) as myNumberFormatted FROM ...
But return type is a number like:
1,000,000.00
instead i want
1.000.000,00
How to do in MySQL ?
Thanks
Select the cells that you want to format. On the Home tab, click the Dialog Box Launcher next to Number. On the Number tab, in the Category list, click Number. To display or hide the thousands separator, select or clear the Use 1000 Separator (,) check box.
Click File > Options. On the Advanced tab, under Editing options, clear the Use system separators check box. Type new separators in the Decimal separator and Thousands separator boxes.
In the United States, we use the decimal or period (“.”) to represent the difference between whole numbers and partial numbers. We use the comma (“,”) to separate groups of three places on the whole numbers side. This might be different from the way you currently write numbers.
Decimal point and decimal comma are also common names for the decimal separator. For example, 9.5 means nine and one half in English speaking countries, while in many European countries, the same number might be written as 9,5.
MySQL>=5.5:
SELECT FORMAT(10000000.5, 2, 'de_DE') AS format
MySQL<5.5:
SELECT REPLACE(REPLACE(REPLACE(FORMAT(10000000.5,2), ',', ':'), '.', ','), ':', '.') AS format
specify locale.
FORMAT(myNumber, 2, 'de_DE')
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