Java Number Format formatNumber(long value)

Here you can find the source of formatNumber(long value)

Description

Formats an integer as a string

License

Open Source License

Parameter

Parameter Description
value Integer

Return

Formatted integer

Declaration

public static String formatNumber(long value) 

Method Source Code

//package com.java2s;

public class Main {
    /**/* w w  w. j ava2 s .c  o  m*/
     * Formats an integer as a string
     * 
     * @param value
     *            Integer
     * @return Formatted integer
     */
    public static String formatNumber(long value) {
        return String.format("%,d", value);
    }

    /**
     * Formats a double as a string
     * 
     * @param value
     *            Double
     * @return Formatted double
     */
    public static String formatNumber(double value) {
        return String.format("%,f", value);
    }
}

Related

  1. FormatNumber(Integer pNumber, int tolLen)
  2. formatNumber(long i, int digits)
  3. formatNumber(long number)
  4. formatNumber(long number, int digits)
  5. formatNumber(long pNum, int pLen)
  6. formatNumber(Number number)
  7. formatNumber(Object num)
  8. formatNumber(String formatStr, int length, boolean leftPadding, char paddingCharacter)
  9. formatNumber(String num, int n)