Answer the question
In order to leave comments, you need to log in
How to add spaces to a string and reduce numbers after a comma?
At the input to the method, a string like 3125126.356356356 is supplied
public static String mySplit(String string) {
String str = null;
str = String.format("%.3f", Double.parseDouble(string));
return str;
}
Answer the question
In order to leave comments, you need to log in
I think one can use DecimalFormat + DecimalFormatSymbols::setDecimalSeparator
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question