Layoit fixes

This commit is contained in:
h4h13 2020-01-28 22:30:28 +05:30
parent 636da3daa8
commit fdb2ab300e
46 changed files with 594 additions and 1346 deletions

View file

@ -42,6 +42,7 @@ import androidx.annotation.Nullable;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.retromusic.App;
import java.text.DecimalFormat;
public class RetroUtil {
@ -65,6 +66,17 @@ public class RetroUtil {
return bitmap;
}
public static String formatValue(float value) {
String arr[] = {"", "K", "M", "B", "T", "P", "E"};
int index = 0;
while ((value / 1000) >= 1) {
value = value / 1000;
index++;
}
DecimalFormat decimalFormat = new DecimalFormat("#.##");
return String.format("%s %s", decimalFormat.format(value), arr[index]);
}
public static float frequencyCount(int frequency) {
return (float) (frequency / 1000.0);
}