0
I need the 2 digits before the . for example if the input 15.14 i want 14 and the input always be with 2 digits after & befor .
Help
3 Respuestas
+ 3
num = (input() or '15.14').split('.')
print(f'.{num[1]}')
+ 3
Panda🐼🐼🐼
It's for positive decimal numbers only.I've written this in java.
Scanner sc=new Scanner(System.in);
double a=sc.nextDouble();
if(a>=10.00&&a<=99.99)
{double b=a-Math.floor(a);
b=b*100;
System.out.print(b);
}
else
{System.out.print("Enter valid input");
}
0
I need vey sample way