제 데이터베이스에는 두 개의 "실제"필드가 있습니다.double에서 float으로 변환 할 수 없습니다.
을 Heres 구조 :
database.execSQL("create table " + TABLE_LOGS + " ("
+ COLUMN_ID + " integer primary key autoincrement,"
+ COLUMN_ID_DAY_EXERCISE + " integer not null,"
+ COLUMN_REPS + " integer not null"
+ COLUMN_WEIGHT + " real not null"
+ COLUMN_1RM + " real not null"
+ COLUMN_DATE + " integer not null"
+ ")");
지금 내가 뭘하려고 내가 데이터베이스에 삽입 할 수 있도록 1RM을 계산이다. 내가 여기에 붙어
public void createLog(long id_day_exercise, float reps, long weight) {
// create 1rm
// create date timestamp
float onerm = weight/(1.0278-(.0278*reps));
long unixTime = System.currentTimeMillis()/1000L;
}
:
여기에 지금까지 내 기능입니다.onerm
에 대해 "double에서 float으로 변환 할 수 없습니다"오류가 발생합니다. 나는 그것을 앞에 (플로트)를 사용하여 플로트로 무게를 캐스팅 시도했다, 나는 weight.floatValue()를 사용하여 시도하고 아무것도 작동하는 것.
이 문제는 저를 위해 작동하지 않습니다 .. –