Example usage for java.lang String valueOf

List of usage examples for java.lang String valueOf

Introduction

In this page you can find the example usage for java.lang String valueOf.

Prototype

public static String valueOf(double d) 

Source Link

Document

Returns the string representation of the double argument.

Usage

From source file:Main.java

public static String stripArrayList(ArrayList<String> text) {
    return String.valueOf(text.get(0));
}

From source file:Main.java

private static String getSubdirectory(String resourceId) {
    return TextUtils.isEmpty(resourceId) ? resourceId : String.valueOf(Math.abs(resourceId.hashCode() % 100));
}

From source file:Main.java

public static String genUUid() {
    UUID uuid = UUID.randomUUID();
    return String.valueOf(uuid).replace("-", "");
}

From source file:Main.java

public static int getMinutesOfWork(long startTime, long currentTime) {
    long timeSpent = currentTime - startTime;
    String timeSpentMinutes = String.valueOf(timeSpent / 60000);
    return Integer.valueOf(timeSpentMinutes);
}

From source file:Main.java

public static String stripIdFromName(String processName, int id) {
    Integer ID = Integer.valueOf(id);

    String[] result = processName.split(String.valueOf(id));
    return result[0];
}

From source file:Main.java

/**
 * Returns OS Version
 *
 * @return String
 */
public static String getOsVersion() {
    return String.valueOf(Build.VERSION.SDK_INT);
}

From source file:Main.java

public static String parseMonth(int month) {
    if ((month + 1) < 10) {
        return "0" + (month + 1);
    } else {//from   w w  w .jav a2s  .c om
        return String.valueOf((month + 1));
    }
}

From source file:Main.java

/**
 * get nonce/*from w w  w  .  j av a2 s  . c  o  m*/
 * @return
 */
public static String getNonce() {
    int random = (int) (Math.random() * 9000) + 1000;
    return String.valueOf(random);
}

From source file:Main.java

public static String kgToLB_ForFatScale(float paramFloat) {
    BigDecimal localBigDecimal1 = new BigDecimal(String.valueOf(paramFloat));
    BigDecimal localBigDecimal2 = new BigDecimal("1155845");
    BigDecimal localBigDecimal3 = new BigDecimal("16");
    BigDecimal localBigDecimal4 = new BigDecimal("65536");
    BigDecimal localBigDecimal5 = new BigDecimal("2");
    return String
            .valueOf(new BigDecimal(String.valueOf(localBigDecimal1.multiply(localBigDecimal2).doubleValue()))
                    .divide(localBigDecimal3, 5, 6).divide(localBigDecimal4, 1, 4).multiply(localBigDecimal5)
                    .floatValue());//from w w w . ja v  a2s.  c  o m
}

From source file:Main.java

public static String getTodaysDate() {
    Calendar c = Calendar.getInstance();
    return c.get(Calendar.YEAR) + "-0" + String.valueOf(c.get(Calendar.MONTH) + 1) + "-"
            + c.get(Calendar.DAY_OF_MONTH);
}