@Test public void testConvertBase() throws Exception { long result = Format.convertBase(16,0,1); Assert.assertTrue(result==1); result = Format.convertBase(16,1,0); Assert.assertTrue(result==160); result = Format.convertBase(16,0,2); Assert.assertTrue(result==0); result = Format.convertBase(16,1,1); Assert.assertTrue(result==16); }
public static long convertBase(long value, int base, int newBase){ long result = value; if (newBase!=base){ result = Double.valueOf((double) value * Math.pow(10, base - newBase)).longValue(); } return result; }
Format { public static long convertBase(long value, int base, int newBase){ long result = value; if (newBase!=base){ result = Double.valueOf((double) value * Math.pow(10, base - newBase)).longValue(); } return result; } }
Format { public static long convertBase(long value, int base, int newBase){ long result = value; if (newBase!=base){ result = Double.valueOf((double) value * Math.pow(10, base - newBase)).longValue(); } return result; }  }
Format { public static long convertBase(long value, int base, int newBase){ long result = value; if (newBase!=base){ result = Double.valueOf((double) value * Math.pow(10, base - newBase)).longValue(); } return result; }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); }
Format { public static long convertBase(long value, int base, int newBase){ long result = value; if (newBase!=base){ result = Double.valueOf((double) value * Math.pow(10, base - newBase)).longValue(); } return result; }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); static final boolean SIMPLE; static final boolean LONG; }