Here you can find the source of formatHex(double theG)
Parameter | Description |
---|---|
theG | a parameter |
private static String formatHex(double theG)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w. j a v a 2s .com * @param theG * @return */ private static String formatHex(double theG) { int value = (int) (theG * 256); String retVal = Integer.toHexString(value); int len = retVal.length(); switch (len) { case 0: retVal = "00"; break; case 1: retVal = "0" + retVal; break; case 2: break; default: retVal = "FF"; } return retVal; } }