Utils { public static String getValueShortString(BigInteger number) { BigInteger result = number; int pow = 0; while (result.compareTo(_1000_) == 1 || result.compareTo(_1000_) == 0) { result = result.divide(_1000_); pow += 3; } return result.toString() + "\u00b7(" + "10^" + pow + ")"; }  static BigInteger unifiedNumericToBigInteger(String number); static String longToDateTime(long timestamp); static String longToTimePeriod(long msec); static ImageIcon getImageIcon(String resource); static String getValueShortString(BigInteger number); static byte[] addressStringToBytes(String hex); static boolean isValidAddress(byte[] addr); static String getAddressShortString(byte[] addr); static SecureRandom getRandom(); static String getHashListShort(List<byte[]> blockHashes); static String getNodeIdShort(String nodeId); static long toUnixTime(long javaTime); static long fromUnixTime(long unixTime); static T[] mergeArrays(T[] ... arr); static String align(String s, char fillChar, int targetLen, boolean alignRight); static String repeat(String s, int n); static List<ByteArrayWrapper> dumpKeys(DbSource<byte[]> ds); static DataWord allButOne64th(DataWord dw); static void showErrorAndExit(String message, String... messages); static void showWarn(String message, String... messages); static String sizeToStr(long size); static void sleep(long ms); static boolean isHexEncoded(String value); static double JAVA_VERSION; }
@Test public void testGetValueShortString4() { String expected = "123\u00b7(10^0)"; String result = Utils.getValueShortString(new BigInteger("123")); assertEquals(expected, result); }
@Test public void testGetValueShortString5() { byte[] decimal = Hex.decode("3913517ebd3c0c65000000"); String expected = "69\u00b7(10^24)"; String result = Utils.getValueShortString(new BigInteger(decimal)); assertEquals(expected, result); }
@Test public void testGetValueShortString1() { int aaa; String expected = "123\u00b7(10^24)"; String result = Utils.getValueShortString(new BigInteger("123456789123445654363653463")); assertEquals(expected, result); }
@Test public void testGetValueShortString2() { String expected = "123\u00b7(10^3)"; String result = Utils.getValueShortString(new BigInteger("123456")); assertEquals(expected, result); }
@Test public void testGetValueShortString3() { String expected = "1\u00b7(10^3)"; String result = Utils.getValueShortString(new BigInteger("1234")); assertEquals(expected, result); }