Reputation: 938
im looking for a way to get some regional settings from windows 8. Settings like this:
Is there some way to get it?
Upvotes: 1
Views: 193
Reputation: 3276
What are you measuring? The regional setting is actually too coarse of a setting (a given region doesn't necessarily align to the same system for temperature, liquid volumes, human weight, object weights) and the scenarios are pretty app specific. The expectation is that this would be an application setting that you would allow the user to modify. In most cases, the world uses Metric and the set of exceptions can be provided as a hard-coded list. You can check the user's HomeGeographicRegion to determine which to list as the default, but it should still be overridable by the user.
Upvotes: 0
Reputation: 522
I recommend you to check the Windows.Globalization.NumberFormatting namespace that "Provides classes for formatting currencies, decimal numbers, percent values, and permille values, based on the user's languages and geographic region."
In this link you can find some examples of it's usage:
// Format with the user's default preferences.
String decimalCurrent = decimalFormat.Format(randomNumber);
//...
results.AppendLine("Random number (" + randomNumber + ")");
results.AppendLine("With current user preferences: " + decimalCurrent);
results.AppendLine("With grouping separators: " + decimal1);
results.AppendLine("With grouping separators (fr-FR): " + decimalFR);
results.AppendLine("With digit substitution (ar): " + decimalAR);
Upvotes: 2