All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.res.android.Formatter Maven / Gradle / Ivy

There is a newer version: 4.14.1
Show newest version
package org.robolectric.res.android;

public class Formatter {
  public static StringBuilder toHex(int value, int digits) {
    StringBuilder sb = new StringBuilder(digits + 2);
    sb.append("0x");
    String hex = Integer.toHexString(value);
    for (int i = hex.length(); i < digits; i++) {
      sb.append("0");
    }
    return sb.append(hex);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy