2014-09-25 66 views

回答

2

我建議您檢查Windows.Globalization.NumberFormatting命名空間,該命名空間提供了「根據用戶的語言和地理區域提供用於格式化貨幣,十進制數,百分比值和permille值的類」。

在此link你可以找到一些例子中它的用法:

// 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); 
+0

我無法在這裏找到測量系統。但我需要這個。 – RenDishen 2014-09-26 10:41:01

0

你在測量?區域設置實際上太粗糙(一個給定的區域不一定與溫度,液體體積,人體重量,物體重量對應於同一個系統),並且這些場景非常適合於應用程序。期望的是,這將是一個允許用戶修改的應用程序設置。在大多數情況下,世界使用度量標準,並且可以將一組例外作爲硬編碼列表提供。您可以檢查用戶的HomeGeographicRegion以確定哪個列表爲默認值,但仍應由用戶覆蓋。