计算进度修改

This commit is contained in:
guozhen 2025-05-10 09:03:24 +08:00
parent d639fe4a5b
commit e4e005e3ac

View File

@ -74,21 +74,11 @@ public class TimeUtils {
}
public static String precess(int current_episode, int episode_total) {
try {
DecimalFormat df = new DecimalFormat("###.00");
double current = Double.parseDouble(df.format(String.valueOf(current_episode)));
double total = Double.parseDouble(df.format(String.valueOf(episode_total)));
double result = Double.parseDouble(df.format(current / total)) * 100;
DecimalFormat df2 = new DecimalFormat("###");
return df2.format(result);
} catch (Exception e) {
//其他语言 .会变成
double current = Double.parseDouble(String.valueOf(current_episode));
double total = Double.parseDouble(String.valueOf(episode_total));
DecimalFormat df = new DecimalFormat("###.00");
DecimalFormat df = new DecimalFormat("###");
return df.format((current / total) * 100);
}
}
}