Java Locale Format formatNumber(long value)

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

Description

format Number

License

Open Source License

Parameter

Parameter Description
value : the number to format.

Return

a number formatted with "," delimiter.

Declaration

public static String formatNumber(long value) 

Method Source Code

//package com.java2s;
/*/*from ww  w  .ja v  a  2s  .  co m*/
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */

import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    /**
     * @param value : the number to format.
     * @return a number formatted with "," delimiter.
     */
    public static String formatNumber(long value) {
        return NumberFormat.getInstance(Locale.ENGLISH).format(value);
    }
}

Related

  1. formatMessage(@Nonnull ResourceBundle bundle, @Nonnull String messageKey, @Nullable Object... args)
  2. formatMessage(String messageKey, Locale locale)
  3. formatMysqlDate(final Date date)
  4. formatNumber(double d, String pattern)
  5. formatNumber(long number)
  6. formatNumber(Number num)
  7. formatNumber(Number number)
  8. formatNumber(Number value, int minDecimals, int maxDecimals, boolean grouping, boolean dotDecimalSymbol)
  9. formatNumber(Number value, String format)