class Main {
public static void main(String[] args) {
String str = "457833.8591000";
str = removeTrailingZeros(str);
System.out.println(str);
}
public static String removeTrailingZeros(String str) {
str = str.replaceAll("0*$", ""); // Remove trailing zeros
str = str.replaceAll("\\.$", ""); // If there's a dot before zeros (.000), remove it too
return str;
}
}
/*
run:
457833.8591
*/