Deciding how things that we used to suck at should work

by Michael S. Kaplan, published on 2012/07/10 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2012/07/10/10328248.aspx


Grammatically inappropriate blog title's awkwardness is [decidedly] intentional, though this sentence's, sadly, is not!

There are some features of NLS that never worked terribly well.

For example, the way currency is so tightly coupled to locale, in  model that encourages typical usage to be based on LOCALE_USER_DEFAULT, or System.Globalization.CultureInfo.CurrentCulture.

Which is not to say that is necessarily always a bad thing, but let me show you an example of where things stutter and fail.

Try to put some money values in an Excel spreadsheet.

Then change your default user locale.

It will change the money unit -- so dollars may become francs or yen or whatever.

Oops!

Clearly the need to separate the notion of the money type from the formatting is not intuitively present for commonly used applications to take advantage of!

So for Windows 8, there is Windows Runtime support for the CurrencyFormatter class, which does not automatically tie these two concepts (the region where money is being spent and the language-esque preferences used to format the money values) quite as tightly!

This is a Very Good Thing, believe me.

But not everyone is quite on board yet. Like when someone just asked some people:

I have a question regarding the CurrencyFormatter behavior with non-matching language and region.

We have price values with currency ISO symbols, and we need to format the price as required by the regions (due to laws, etc.).

Can you please confirm if the actual formatting from the CurrencyFormatter for the following scenarios are correct?

Thank you.

Scenarios:
Input:
• Currency: USD
• Region: US
• Language: de-DE
Expected formatting: $12.34 (standard USD format)
Actual formatting: 12.34 $


Input:
• Currency: EURO
• Region: DE
• Language: en-US
Expected formatting: 12.34 € (standard EURO format)
Actual formatting: €12.34

Now I'm obviously not working on that class, but I have a hard time accepting the Expected formatting info to actually be expected.

That would be behavior worthy of Excel, frankly....

And we've waited a long time to get a more intuitive an understandable behavior in place here.

Let's try and enjoy it!


Ice-Wolf on 12 Jul 2012 1:44 PM:

I would never expect the Euro sign to come after the amount in English.   €12.34 is definitely the expected format.

just like in a German context   I would say the expected should be    "12,34 $" (rather than the actual typed above "12.34 $"

I'd say having it formatted as "Der Preis: $12.34"  would give more of a start... 1,234 dollars? (with the . and the $ in the wrong spot...)


referenced by

2012/07/13 There are 3 kinds of people....

go to newer or older post, or back to index or month or day