如何将123456789
的int值格式设置为123,456,789
?
最佳答案
试试这个代码
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
DecimalFormat formatter = new DecimalFormat("###,###,###");
System.out.print(formatter.format(123456789));
}
}
您可以在jsp块<%中编写一个函数! %>和main方法中的代码。
关于jsp - jsp中的格式编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5508063/