0

How to read in a floating-point number?

I want to read in a floating-point number using Scanner. Anyone knows how to do this?

16th Feb 2017, 7:47 PM
Alex Bc
Alex Bc - avatar
2 Answers
+ 6
.nextFloat(); works too.
16th Feb 2017, 8:08 PM
Salva PĂ©rez
Salva PĂ©rez - avatar
+ 1
I figured it out already. I used .nextDouble();
16th Feb 2017, 7:57 PM
Alex Bc
Alex Bc - avatar