List of usage examples for java.lang String valueOf
public static String valueOf(double d)
From source file:Main.java
public static String buildTransaction(final String type) { return (type == null) ? String.valueOf(System.currentTimeMillis()) : type + System.currentTimeMillis(); }
From source file:Main.java
public static Uri getSongUri(int id) { String albumId = String.valueOf(id); Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart"); Uri albumArtUri = ContentUris.withAppendedId(sArtworkUri, Integer.valueOf(albumId)); return albumArtUri; }
From source file:Main.java
public static String getQueryDateFormat(String datestr) { String[] substrings = datestr.split("/"); return String.valueOf(new StringBuilder().append(substrings[2]).append("-").append(substrings[0]) .append("-").append(substrings[1])); }
From source file:Main.java
public static String getYear() { Calendar calendar = Calendar.getInstance(); return String.valueOf(calendar.get(Calendar.YEAR)); }
From source file:Main.java
private static String longTile(final int tile, final boolean makeLong) { if (makeLong) { String lt = String.valueOf(tile); while (lt.length() < 4) { lt = "0" + lt; }/*from www. ja v a2 s. c o m*/ return lt; } else { return String.valueOf(tile); } }
From source file:Main.java
public static String formatNum(int i1) { String s = String.valueOf(i1); if (i1 == 0) { s = "0000"; } else if (s.length() < 4) { switch (s.length()) { default:/*from www.jav a2 s .c o m*/ return s; case 1: // '\001' return (new StringBuilder()).append("000").append(s).toString(); case 2: // '\002' return (new StringBuilder()).append("00").append(s).toString(); case 3: // '\003' return (new StringBuilder()).append("0").append(s).toString(); } } return s; }
From source file:Main.java
private static String intiNum(int i) { if (i < 1000) { return String.valueOf(i); } else {/*from w ww.jav a 2s. c om*/ int qian = i / 1000; int bai = i % 1000 / 100; return qian + "." + bai + "k"; } }
From source file:Main.java
/** * get timestamp/* ww w . ja v a 2s .c o m*/ * @return */ public static String getTimeStamp() { return String.valueOf(new Date().getTime() / 1000).substring(0, 10); }
From source file:Main.java
public static String precisionDistance(double distance) { if (distance < 0.1) { return String.valueOf((int) (distance * 1000)); }/* w ww . jav a2 s.c o m*/ if (distance >= 0.1 && distance < 1) { int temp = (int) (distance * 1000); if (temp % 10 < 5) return String.valueOf((temp / 10) * 10); else return String.valueOf(((temp + 10) / 10) * 10); } if (distance >= 1 && distance < 10) { return String.valueOf(roundDistance(distance)); } else { return String.valueOf((int) distance); } }
From source file:Main.java
public static String getEncodingLibraryPath(Context paramContext) { return new StringBuilder(String.valueOf(paramContext.getApplicationInfo().nativeLibraryDir)) .append("/libencoding.so").toString(); }