Parse values to NetServer format
Audience:
Some tooltip text!
• 1 minute to read
• 1 minute to read
When a user enters a value, it needs to be converted into a formatted value before being sent back to the web service for processing. This conversion needs to happen on the client, where we know the localization settings (the current culture).
If the user types in 1234,5 (a Norwegian floating-point value), we need to turn this into a floating-point value.
using SuperOffice.CRM.Globalization;
string encoded = "1234,5";
double theNumber;
Double.TryParse(out encoded);
string formatted = CultureDataFormatter.EncodeDouble( theNumber );
// formatted = "[D:1234.5]"