Java Locale Format formatInt(final int number)

Here you can find the source of formatInt(final int number)

Description

Format the given int to a int with ,'s in it.

License

Open Source License

Parameter

Parameter Description
number the int to format.

Return

The formated integer.

Declaration

public static String formatInt(final int number) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.NumberFormat;
import java.util.Locale;

public class Main {
    /**//w w  w.  j av  a 2s.  c  o m
     * Format the given int to a int with ,'s in it.
     * 
     * @param number the int to format.
     * @return The formated integer.
     */
    public static String formatInt(final int number) {
        final NumberFormat formater = NumberFormat.getInstance(Locale.UK);

        return formater.format(number);
    }
}

Related

  1. formatFloat(Float f, int style)
  2. formatFloat(float val)
  3. formatFraction2(final Number value)
  4. formatInCurrentDefaultLocale(double d)
  5. formatingDecimalNumber(Object obj, Locale locale, int maxIntPart, int maxFloatPart)
  6. formatInteger(int input)
  7. formatInteger(Long num)
  8. formatIntWithCommas(int num)
  9. formatLines(String target, int maxLength, Locale currentLocale)