I’m working on a desktop application that may potentially be deployed world-wide. My biggest issue with internationalization is currencies. A couple questions:
I’m using SQL Server Compact Edition, which supports the MONEY type. My first question is will this handle data storage regardless of the user’s culture?
My second question is data processing. I know I can use the “C” format string, and I guess that’s all right for displaying, but when saving back how do I handle user-entered values? Is there a standard way to parse the entered value and save it to the MONEY field, all while being culture-aware and not having to write for any kind of exceptions?
I’m working with C# in WPF, but I’m guessing there is probably a near-universal solution to all this.
The
MONEYtype just tells the system to use the required accuracy and rounding rules required to handle monetary calculations properly. It doesn’t know anything about the actual currency. You need to handle that in the UI and with currency conversion rules.The framework uses the current culture to display the correct currency symbol for monetary string formats, but if you are displaying different currencies you’ll need to override this behaviour.
With C#/WPF (and Silverlight) if you output the currency using the
StringFormatin XAML then it handles the user input as well (or at least it has in my experience).