Int AB (float a)
{
A=a * 1000;
String A=a.T oString ();
String [] s=A.S plit (new char [] {'. '});
If (s.L ength==2) {
String s1=s [1];
Int I=s1. Length;
If (I & gt; {
=3)I=3;
}
Return s1. The Substring (0, I);
}
Return A;
CodePudding user response:
Return int. Parse (s1. The SubString (0, 1));
CodePudding user response:
You put the float to an int, error is normal,
CodePudding user response: