Bug #36372 format(X,D) european output request
Submitted: 28 Apr 2008 11:17 Modified: 6 Oct 2008 13:20
Reporter: Alexander Dewilde Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.0 OS:Any (Mac OS X, Linux)
Assigned to: CPU Architecture:Any
Tags: string functions

[28 Apr 2008 11:17] Alexander Dewilde
Description:
format(X,D) still returns US formatting.
Many users have requested this over time, and I remember seeing 'this should be internationalized at some point...' in MySQL source.

Untill now, it is impossible to achieve desired european formatting without having a huge speed penalty, whatever conversion technique is used.

How to repeat:
format(1234567.89) -> 1,234,567.89

what we need is 1.234.567,89 performed at same speed as above

Suggested fix:
A MySQL variable to choose thousand and decimal separator, much like the date or time setting variable at this point.
[28 Apr 2008 15:03] Peter Laursen
I think this should be a general client/session setting for all decimals!

Ideally a SETTABLE LOCAL system variable like DECIMAL_FORMAT {English|Continental|System} (where 'System' will fetch the LOCALE of the client machine).
[28 Apr 2008 17:27] Sveta Smirnova
Thank you for the reasonable feature reauest.

Workaround:

select replace(replace(replace(format(X, D), ',', '_'), '.', ','), '_', '.');
[28 Apr 2008 17:32] Alexander Dewilde
I do know several workarounds, but they all have severe speed penalties.

I still like this to be fixed... Any ideas about when it will finally be implemented?
[6 Oct 2008 13:20] Alexander Dewilde
Any progress on the requested feature?

If mysql is not planning to implement this feature,
maybe you should release the necessary code in order to do it yourself?
[9 Oct 2008 11:24] Sergei Golubchik
Yes, we do plan to implement this feature.
In the not too distant future even. But not in 5.0 or 5.1.