Here you can find the source of formatNumber(int source)
Parameter | Description |
---|---|
source | a parameter |
public static String formatNumber(int source)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { /**/* w w w.j ava 2 s .c om*/ * @param source * @return */ public static String formatNumber(int source) { String pattern = "###,###"; DecimalFormat decimalFormat = new DecimalFormat(pattern); String format = decimalFormat.format(source); return format; } }