|
8 | 8 | using System.Data;
|
9 | 9 | using System.Diagnostics;
|
10 | 10 | using System.Drawing;
|
| 11 | +using System.Globalization; |
11 | 12 | using System.Linq;
|
12 | 13 | using System.Windows.Forms;
|
13 | 14 |
|
@@ -63,9 +64,8 @@ private void CalcForm_Load(object sender, EventArgs e)
|
63 | 64 | + "(x**2+y**2-1)**3 == x**2*y**3 // Heart\n"
|
64 | 65 | + "@purple rnd()*abs(x*y)<0.25 // Noisy star\n"
|
65 | 66 | + "x^2+y^2 < 4 || (+y < 0.5 && +x < 4) || (+y < 5 && +x in (4,5)) // Tie fighter\n"
|
66 |
| - + "4 % x\n" |
67 |
| - + "\n"); |
68 |
| - SetUpComboBox(cbVariables, "Variables", $"x=1\n" |
| 67 | + + "4 % x\n" + "\n"); |
| 68 | + SetUpComboBox(cbVariables, "Variables", "x=1\n" |
69 | 69 | + "x=1; r=sqrt(x**2+y**2); theta=mod(atan(y,x),tau)");
|
70 | 70 | SetUpComboBox(cbRanges, "Ranges", "-10..10;\n"
|
71 | 71 | +"-5..5; \n"
|
@@ -159,7 +159,8 @@ OutputState PrepareCalculators()
|
159 | 159 | try {
|
160 | 160 | // Parse the three combo boxes and build a dictionary of variables
|
161 | 161 | var exprs = ParseExprs("Formula", cbFormulas.Text);
|
162 |
| - var variables = ParseExprs("Variables", $"pi={Math.PI};tau={Math.PI*2};e={Math.E};phi=1.6180339887498948; {cbVariables.Text}"); |
| 162 | + var variables = ParseExprs("Variables", string.Format(CultureInfo.InvariantCulture, |
| 163 | + "pi={0};tau={1};e={2};phi=1.6180339887498948; {3}", Math.PI, Math.PI*2, Math.E, cbVariables.Text)); |
163 | 164 | var ranges = ParseExprs("Range", cbRanges.Text);
|
164 | 165 | var varDict = CalculatorCore.ParseVarList(variables);
|
165 | 166 |
|
@@ -313,7 +314,7 @@ private void btnCopy_Click(object sender, EventArgs e)
|
313 | 314 | void SetRanges(CalcRange xRange, CalcRange yRange, string zRangeText)
|
314 | 315 | {
|
315 | 316 | // Refreshes display as side effect
|
316 |
| - var newRanges = string.Format("{0:G8}..{1:G8}; {2:G8}..{3:G8}; {4}", |
| 317 | + var newRanges = string.Format(CultureInfo.InvariantCulture, "{0:G8}..{1:G8}; {2:G8}..{3:G8}; {4}", |
317 | 318 | xRange.Lo, xRange.Hi, yRange.Lo, yRange.Hi, zRangeText);
|
318 | 319 | Trace.WriteLine(newRanges);
|
319 | 320 | cbRanges.Text = newRanges;
|
|
0 commit comments