mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Add format string method
This commit is contained in:
parent
9fa217d587
commit
6bf1d82318
1 changed files with 9 additions and 0 deletions
|
@ -8,6 +8,7 @@ import android.util.Log;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
@ -45,4 +46,12 @@ public class Utils {
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
return r.nextInt(max - min) +max;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue