diff --git a/app/src/main/java/net/foucry/pilldroid/Utils.java b/app/src/main/java/net/foucry/pilldroid/Utils.java index 0db4c80..bff52ba 100644 --- a/app/src/main/java/net/foucry/pilldroid/Utils.java +++ b/app/src/main/java/net/foucry/pilldroid/Utils.java @@ -8,6 +8,7 @@ import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Locale; import java.util.Random; public class Utils { @@ -45,4 +46,12 @@ public class Utils { Random r = new Random(); return r.nextInt(max - min) +max; } + + public static String fmt(double d) + { + if(d == (long) d) + return String.format(Locale.getDefault(),"%d",(long)d); + else + return String.format("%s",d); + } }