コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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;
     }
 }