Java Fraction Format formatDecimal(double value)

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

Description

format Decimal

License

Open Source License

Declaration

public static String formatDecimal(double value) 

Method Source Code


//package com.java2s;
/*/*from w  ww  .  j ava2 s.  c o m*/
 * This software copyright by various authors including the RPTools.net
 * development team, and licensed under the LGPL Version 3 or, at your option,
 * any later version.
 * 
 * Portions of this software were originally covered under the Apache Software
 * License, Version 1.1 or Version 2.0.
 * 
 * See the file LICENSE elsewhere in this distribution for license details.
 */

import java.text.NumberFormat;

public class Main {
    private static NumberFormat nf = NumberFormat.getNumberInstance();

    public static String formatDecimal(double value) {
        String result1;
        result1 = nf.format(value); // On a separate line to allow for breakpoints
        return result1;
    }
}

Related

  1. formatData(double aAmount)
  2. formatDataValue(double value)
  3. formatDecimal(double dtSource, String nbit)
  4. formatDecimal(double number)
  5. formatDecimal(double numToFormat)
  6. formatDecimal(double value, int maxFractionDigits1, int maxFractionDigits2)
  7. formatDecimal(double value, int precision)
  8. formatDecimal(double value, String mask)
  9. formatDecimal(String format, double value)