List of usage examples for java.lang String format
public static String format(String format, Object... args)
From source file:Main.java
public static String padLeft(String s, int n, String c) { return String.format("%1$" + n + "s", s).replaceAll(" ", c); }
From source file:Main.java
public static String padRight(String s, int n, String c) { return String.format("%1$-" + n + "s", s).replaceAll(" ", c); }
From source file:Main.java
private static String getCustomDimensionKey(int paramInt) { return String.format("%s%s", new Object[] { "c", String.valueOf(paramInt - 1) }); }
From source file:Main.java
public static String generateHexFromString(String string) { return String.format("#ff" + "%06X", (0xFFFFFF & string.hashCode())); }
From source file:Main.java
public static String getThreadGroupName(String poolName) { return String.format("pa-%s-pool", poolName); }
From source file:Main.java
public static String getFormatTwo(double num) { String result = String.format("%.2f", num); return result; }
From source file:Main.java
public static String getNif(int number) { String numberStr = String.format("%08d", number); return numberStr + getNifLetter(number); }
From source file:Main.java
public static String truncateBidPrice(String bidPrice) { bidPrice = String.format("%.2f", Float.parseFloat(bidPrice)); return bidPrice; }
From source file:Main.java
public static String format(String template, Object... values) { return String.format(template.replace("{}", "%s"), values); }
From source file:Main.java
public static String printCustomerID(long id) { String idString = String.format("%05d", id); String newStringID = ""; newStringID += idString.substring(0, 2) + "-"; newStringID += idString.substring(2, 5); return newStringID; }