Skip to content

Commit

Permalink
Add DecimalFormatSymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
itstrueitstrueitsrealitsreal committed Aug 7, 2024
1 parent 9742d6f commit 8d38f69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/teammates/common/util/StringHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package teammates.common.util;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -179,7 +180,9 @@ public static <T> String toString(List<T> list, String delimiter) {
* Converts a double value between 0 and 1 to 3dp-string.
*/
public static String toDecimalFormatString(double doubleVal) {
DecimalFormat df = new DecimalFormat("0.###");
DecimalFormatSymbols syms = new DecimalFormatSymbols();
syms.setDecimalSeparator('.');
DecimalFormat df = new DecimalFormat("0.###", syms);
return df.format(doubleVal);
}

Expand Down

0 comments on commit 8d38f69

Please sign in to comment.