Java Long Number Readable Format toLocalizedInteger(long value)

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

Description

This static method converts the passed in number into a localizable representation of an integer, with digit grouping using locale dependant separators.

License

Open Source License

Parameter

Parameter Description
value the number to convert to a numeric String.

Return

a localized String representing the integer value

Declaration

public static String toLocalizedInteger(long value) 

Method Source Code

//package com.java2s;
/*/* www.java 2  s . com*/
 * 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;

public class Main {
    /**
     * Localizable Number Format constant for the current default locale
     * set at init time.
     */
    private static NumberFormat NUMBER_FORMAT0;

    /**
     * This static method converts the passed in number
     * into a localizable representation of an integer, with
     * digit grouping using locale dependant separators.
     *
     * @param value the number to convert to a numeric String.
     *
     * @return a localized String representing the integer value
     */
    public static String toLocalizedInteger(long value) {
        return NUMBER_FORMAT0.format(value);
    }
}

Related

  1. toHuman(long amount)
  2. toHumanReadableSize(long byteCount)
  3. toHumanReadableSize(long bytes)
  4. toHumanSize(long bytes)
  5. toKilobytes(long bytes)
  6. toMB(long b)
  7. toMB(long bytes)
  8. toReadableBytes(long bytes)
  9. toReadableNumber(long number)