Skip to content

Commit c19e02a

Browse files
committed
Issue #549: locale issue fix.
1 parent 9743049 commit c19e02a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugin/src/org/aavso/tools/vstar/external/plugin/VeLaObSource.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
import java.io.StringWriter;
3636
import java.nio.charset.Charset;
3737
import java.nio.charset.StandardCharsets;
38+
import java.text.DecimalFormatSymbols;
3839
import java.util.List;
40+
import java.util.Locale;
3941
import java.util.Map;
4042
import java.util.Optional;
4143

@@ -710,7 +712,7 @@ private void testInput() {
710712
maxJD.setValue(2457505.0);
711713
points.setValue(501);
712714
jDflavour.setSelectedIndex(dateTypeToSelectedIndex("HJD"));
713-
codeArea.setText(
715+
String test_model =
714716
"# test model\n\n" +
715717
"zeroPoint is 2457504.93 # time zero point\n" +
716718
"magZeroPoint is 13.69\n" +
@@ -723,7 +725,12 @@ private void testInput() {
723725
" + 0.006091217702922 * cos(2*PI*(4/period)*(t-zeroPoint)) + 0.001654399074451 * sin(2*PI*(4/period)*(t-zeroPoint))\n" +
724726
" - 0.004698206584795 * cos(2*PI*(5/period)*(t-zeroPoint)) - 0.000039671630067 * sin(2*PI*(4/period)*(t-zeroPoint))\n" +
725727
" + 0.003549883073703 * cos(2*PI*(6/period)*(t-zeroPoint)) + 0.000022578051393 * sin(2*PI*(6/period)*(t-zeroPoint))\n" +
726-
"}\n");
728+
"}\n";
729+
DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.getDefault());
730+
char decimalSeparator = symbols.getDecimalSeparator();
731+
if (decimalSeparator != '.')
732+
test_model = test_model.replace('.', decimalSeparator);
733+
codeArea.setText(test_model);
727734
titleXfield.setValue("");
728735
titleYfield.setValue("");
729736
objectNameField.setValue("");

0 commit comments

Comments
 (0)