Home > Back-end >  Java how to 1001 output into 1.1
Java how to 1001 output into 1.1

Time:11-01

Java how to 1001 output into 1.1

CodePudding user response:

Public class Test {
Public static void main (String [] args) {
Int a=1001;
String STR=Integer. ToString (a);
Strings str1=STR. Replace (" 00 ", "");
System. The out. Println (str1);
}
}
Put the number into a string, and then put the "00" replace "."

CodePudding user response:

Problem lack of conditions
  • Related