private static void SetDisplayFormat(NumericTextBox textBox) { if (textBox.NumericValue.HasValue) { textBox.Text = textBox.NumericValue.Value.ToString(textBox.NumericValueFormat, CultureInfo.DefaultThreadCurrentCulture); } else { textBox.Text = string.Empty; } }
private static void SetEditFormat(NumericTextBox textBox) { if (textBox.NumericValue.HasValue) { var numberFormant = CultureInfo.InvariantCulture.NumberFormat; textBox.Text = textBox.NumericValue.Value.ToString(textBox.NumericValueFormat, CultureInfo.InvariantCulture).Replace(numberFormant.NumberGroupSeparator, string.Empty); } else { textBox.Text = string.Empty; } }