Reputation: 3827
I'm using FORMAT function to show number in local currency but it returns wrong (old, depreciated) currency.
I'm using ...
SELECT FORMAT(1, 'C', 'hr-HR')
It returns ...
1,00 kn
It should return ...
1,00 €
As Croatia (hr-HR) changed currency to EUR from 2023-01-01.
Environment: SQL 2019 Std, Windows Srv 2016 Std.
How can I get the right value through FORMAT function?
Upvotes: 0
Views: 361
Reputation: 3623
As we discussed in comments;
Your .Net version might not be up-to-date with latest currency changes.
Either your version of .net isn't aware of the currency change, or you aren't using the latest version of it.
You can try updating your .NET Framework on the host and retest the behavior.
If it is not possible;
You can simply format it as SELECT FORMAT(1, '0.00 "€"', 'hr-HR');
Update :
with the latest .NET 4.8 for WinSrv 2016 still the same problem
Can you format it like this :
SELECT FORMAT(1, CONCAT('N', CHAR(8364)), 'hr-HR');
8364 is unicode symbol for Euro.
Upvotes: 1