当我输出 pW 它给了我原始值
double plateWt = wWeight - bWval;
while (plateWt > 200 && plate100val > 0) {
plateWt = plateWt - 200;
plate100 ++;
plate100val --;
}
while (plateWt > 90 && plate45val > 0) {
plateWt = plateWt - 90;
plate45 ++;
plate45val --;
}
while (plateWt > 70 && plate35val > 0) {
plateWt = plateWt - 70;
plate35 ++;
plate35val --;
}
while (plateWt > 50 && plate25val > 0) {
plateWt = plateWt - 50;
plate25 ++;
plate25val --;
}
while (plateWt > 20 && plate10val > 0) {
plateWt = plateWt - 20;
plate10 ++;
plate10val --;
}
while (plateWt > 10 && plate5val > 0) {
plateWt = plateWt - 10;
plate5 ++;
plate5val --;
}
while (plateWt > 5 && plateQval > 0) {
plateWt = plateWt - 5;
plateQ ++;
plateQval --;
}
Log.i("LOG_TAG", "PlateWeight value: " + plateWt);
double pw = plateWt;
warmupPlatesOneTextView.setText(String.valueOf(pw));
11-25 15:16:16.867: I/LOG_TAG(21569): PlateWeight 值: 5.0 11-25 15:16:16.883: I/LOG_TAG(21569): PlateWeight 值: 10.0 11-25 15:16:17.121: I /LOG_TAG(21569):PlateWeight 值:45.0 11-25 15:16:17.145:I/LOG_TAG(21569):PlateWeight 值:45.0