private void Equal_Click(object sender, RoutedEventArgs e) { string val = this.TextBox.Text; if (val[val.Length - 1] == '.') { val += 0; } Val2 = Convert.ToDouble(val, System.Globalization.CultureInfo.InvariantCulture); switch (op) { case Operand.Add: this.TextBox.Text = (Val1 + Val2).ToString(); break; case Operand.Sub: this.TextBox.Text = (Val1 - Val2).ToString(); break; case Operand.Multi: this.TextBox.Text = (Val1 * Val2).ToString(); break; case Operand.Div: this.TextBox.Text = (Val1 / Val2).ToString(); break; case Operand.None: this.TextBox.Text = Val1.ToString(); break; } }
public String Values() { return(String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20}, {21}, '{22}'", Id, Code, Val1.ToString(CultureInfo.InvariantCulture), Val2.ToString(CultureInfo.InvariantCulture), Val3.ToString(CultureInfo.InvariantCulture), Val4.ToString(CultureInfo.InvariantCulture), Val5.ToString(CultureInfo.InvariantCulture), Val6.ToString(CultureInfo.InvariantCulture), Val7.ToString(CultureInfo.InvariantCulture), Val8.ToString(CultureInfo.InvariantCulture), Val9.ToString(CultureInfo.InvariantCulture), Val10.ToString(CultureInfo.InvariantCulture), Val11.ToString(CultureInfo.InvariantCulture), Val12.ToString(CultureInfo.InvariantCulture), Val13.ToString(CultureInfo.InvariantCulture), Val14.ToString(CultureInfo.InvariantCulture), Val15.ToString(CultureInfo.InvariantCulture), Val16.ToString(CultureInfo.InvariantCulture), Val17.ToString(CultureInfo.InvariantCulture), Val18.ToString(CultureInfo.InvariantCulture), Val19.ToString(CultureInfo.InvariantCulture), Val20.ToString(CultureInfo.InvariantCulture), Description.Replace("'", @"\'"))); }