Skip to content

Commit 60c9d0d

Browse files
committed
Percentage is formatted with a dot(.) instead of comma(,) in JAR build also.
1 parent ab9acd6 commit 60c9d0d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/ee/ut/similaritydetector/backend/SimilarSolutionPair.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package ee.ut.similaritydetector.backend;
22

3+
import java.util.Locale;
4+
35
public class SimilarSolutionPair {
46

57
private final double similarity;
@@ -17,7 +19,7 @@ public SimilarSolutionPair(double similarity, Solution firstSolution, Solution s
1719
this.secondSolution = secondSolution;
1820
author1 = firstSolution.getAuthor();
1921
author2 = secondSolution.getAuthor();
20-
similarityPercentage = String.format("%.1f%%", similarity * 100);
22+
similarityPercentage = String.format(Locale.ENGLISH,"%.1f%%", similarity * 100);
2123
}
2224

2325
public double getSimilarity() {

src/main/java/ee/ut/similaritydetector/ui/utils/ExerciseStatistics.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.math.BigDecimal;
77
import java.math.RoundingMode;
8+
import java.util.Locale;
89

910
/**
1011
* Data class for convenient inserting of data to the table in results view.
@@ -68,7 +69,7 @@ public ExerciseStatistics(Exercise exercise, Analyser analyser) {
6869
analyser.isPreprocessSourceCode() ?
6970
exercise.getAverageSolutionPreprocessedCodeLength() :
7071
exercise.getAverageSolutionSourceCodeLength());
71-
this.similarityThreshold = String.format("%.1f%%", exercise.getSimilarityThreshold() * 100);
72+
this.similarityThreshold = String.format(Locale.ENGLISH,"%.1f%%", exercise.getSimilarityThreshold() * 100);
7273
}
7374

7475
}

0 commit comments

Comments
 (0)