Java和JS的千分位分隔符
Java:
package com.xieh; import java.text.DecimalFormat; public class MoneyFormat { public static void main(String args[]) { double n = 2000000.1458; DecimalFormat df = new DecimalFormat("#,###.00"); String m = df.format(n); System.out.print(m); } }
JavaScript: