Java Fraction Format formatInt(double value)

Here you can find the source of formatInt(double value)

Description

Formats a specified numeric value as int.

License

Open Source License

Parameter

Parameter Description
value a value to be formatted

Return

the formatted string.

Declaration

public static String formatInt(double value) 

Method Source Code

//package com.java2s;
/**//from ww w. jav  a2 s.  c o  m
 * This file is part of Apache Spark Benchmark.
 *
 * Apache Spark Benchmark 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 2, or (at your option) any later
 * version.
 *
 * Apache Spark Benchmark 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; see the file COPYING. If not, see
 * <http://www.gnu.org/licenses/>.
 */

import java.text.*;

public class Main {
    /**
     * Int Number Formatter
     */
    private static final DecimalFormat INT_FORMAT = new DecimalFormat("###,###,###");

    /**
     * Formats a specified numeric value as int.
     *
     * @param value a value to be formatted
     * @return the formatted string.
     */
    public static String formatInt(double value) {
        return INT_FORMAT.format(value);
    }
}

Related

  1. formatFloat(String format, double f)
  2. formatFloatToStr(Float str)
  3. FormatFolat(Float num)
  4. formatGetal(float getal)
  5. formatIndexValuePairs(List indicies, List values, String valueSeparator, String rangeSeparator)
  6. formatIntoCurr(double num, int digits)
  7. formatIntRate(double rateInt)
  8. formatKnots(double v)
  9. formatManeyPattern(String pattern, Double amount)