package smp;
import java.text.DecimalFormat;
public class CurrencyFormat {
public static String format(long curr) {
DecimalFormat formatter = new DecimalFormat("###,###,###");
String s = formatter.format(curr);
if (curr < 0) {
return "<font color=\"red\">" + s + "</font>";
}
return s;
}
}
|