public Utils.round() moved to private Localization.round()

This commit is contained in:
bopol 2020-02-28 16:59:52 +01:00
parent dfaa5675b6
commit 22aa6d16a2
2 changed files with 6 additions and 12 deletions

View File

@ -18,6 +18,8 @@ import org.ocpsoft.prettytime.units.Decade;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.localization.ContentCountry;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.util.Arrays;
@ -26,7 +28,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import static org.schabi.newpipe.util.Utils.round;
/*
* Created by chschtsch on 12/29/15.
@ -261,4 +262,8 @@ public class Localization {
public static void assureCorrectAppLanguage(Context c) {
changeAppLanguage(getAppLocale(c), c.getResources());
}
private static double round(double value, int places) {
return new BigDecimal(value).setScale(places, RoundingMode.HALF_UP).doubleValue();
}
}

View File

@ -1,11 +0,0 @@
package org.schabi.newpipe.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Utils {
public static double round(double value, int places) {
return new BigDecimal(value).setScale(places, RoundingMode.HALF_UP).doubleValue();
}
}