Skip to content

Commit fad91a5

Browse files
committed
Fix: java.lang.NumberFormatException
1 parent b9a245a commit fad91a5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

improveai-android/src/main/java/ai/improve/android/AppGivensProviderUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ public static double versionToNumber(String versionString) {
135135
IMPLog.e(Tag, versionString + ", versionToInt error, " + t.getLocalizedMessage());
136136
}
137137
}
138-
return Double.parseDouble(String.format("%.6f", version));
139-
// return version;
138+
return Math.round(version * 1000000) / 1000000.0;
140139
}
141140

142141
public static void addRewardForModel(String modelName, double reward) {
@@ -156,7 +155,7 @@ public static double rewardOfModel(String modelName) {
156155

157156
public static double roundedRewardOfModel(String modelName) {
158157
double reward = rewardOfModel(modelName);
159-
return Math.round(reward * 100000) / 1000000.0;
158+
return Math.round(reward * 1000000) / 1000000.0;
160159
}
161160

162161
public static double rewardsPerDecision(String modelName) {

0 commit comments

Comments
 (0)