cannot convert from double to float cannot convert from double to float android android

cannot convert from double to float


Have you tried this?

float onerm = (float) (weigth/(1.0278-(.0278*reps)));


What about this approach?

Float.valueOf(String.valueOf(your_double_variable));


Casting from a double to a float can be done like this:

double d = 1.2;float f = (float) d;

Or if you just need to express 1.2 as a float to start with, then use 1.2f.

Note