@Test public void testFormatWithSmartDecimal() throws Exception { }
public static String formatWithSmartDecimal(long amount) { if (amount < 0) { return "- " + formatWithSmartDecimal(-amount); } DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.getDefault()); String resultPartToIgnore = currencyFormatter.getDecimalFormatSymbols().getDecimalSeparator() + "00"; String result = String.valueOf(amount); return result.replace(resultPartToIgnore, ""); }
Formater { public static String formatWithSmartDecimal(long amount) { if (amount < 0) { return "- " + formatWithSmartDecimal(-amount); } DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.getDefault()); String resultPartToIgnore = currencyFormatter.getDecimalFormatSymbols().getDecimalSeparator() + "00"; String result = String.valueOf(amount); return result.replace(resultPartToIgnore, ""); } }
Formater { public static String formatWithSmartDecimal(long amount) { if (amount < 0) { return "- " + formatWithSmartDecimal(-amount); } DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.getDefault()); String resultPartToIgnore = currencyFormatter.getDecimalFormatSymbols().getDecimalSeparator() + "00"; String result = String.valueOf(amount); return result.replace(resultPartToIgnore, ""); }  }
Formater { public static String formatWithSmartDecimal(long amount) { if (amount < 0) { return "- " + formatWithSmartDecimal(-amount); } DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.getDefault()); String resultPartToIgnore = currencyFormatter.getDecimalFormatSymbols().getDecimalSeparator() + "00"; String result = String.valueOf(amount); return result.replace(resultPartToIgnore, ""); }  static String quantitatifFormatter(long quantitatif, String currencyName); static String big_quantitatifFormatter(BigInteger quantitatif, String currencyName); static String big_relatifFormatter(Context context, int decimal, BigDecimal relatif); static String timeFormatterV2(Context context, long allMilli); static String relatifFormatter(Context context, int decimal, double relatif); static String formatWithSmartDecimal(long amount); }
Formater { public static String formatWithSmartDecimal(long amount) { if (amount < 0) { return "- " + formatWithSmartDecimal(-amount); } DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.getDefault()); String resultPartToIgnore = currencyFormatter.getDecimalFormatSymbols().getDecimalSeparator() + "00"; String result = String.valueOf(amount); return result.replace(resultPartToIgnore, ""); }  static String quantitatifFormatter(long quantitatif, String currencyName); static String big_quantitatifFormatter(BigInteger quantitatif, String currencyName); static String big_relatifFormatter(Context context, int decimal, BigDecimal relatif); static String timeFormatterV2(Context context, long allMilli); static String relatifFormatter(Context context, int decimal, double relatif); static String formatWithSmartDecimal(long amount); static final String MAX_INTEGER; static final BigInteger MILLION; static final BigInteger MILLIARD; static final BigInteger BILLION; static final BigInteger BILLIARD; static final BigInteger TRILLION; static final BigInteger TRILLIARD; }