Here you can find the source of formatInt(double value)
Parameter | Description |
---|---|
value | a value to be formatted |
public static String formatInt(double value)
//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); } }