Java Fraction Format formatDisplay(Double value)

Here you can find the source of formatDisplay(Double value)

Description

format Display

License

BSD License

Parameter

Parameter Description
value to display in our format

Return

the double display format string

Declaration

public static String formatDisplay(Double value) 

Method Source Code

//package com.java2s;
/**//  w  w w . j  a  v a 2s .c  om
 * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/caintegrator/LICENSE.txt for details.
 */

import java.text.DecimalFormat;

public class Main {
    private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.####################");

    /**
     * 
     * @param displayString to display in our format
     * @return the double display format string
     */
    public static String formatDisplay(String displayString) {
        return DECIMAL_FORMAT.format(Double.valueOf(displayString));
    }

    /**
     * 
     * @param value to display in our format
     * @return the double display format string
     */
    public static String formatDisplay(Double value) {
        return DECIMAL_FORMAT.format(value);
    }
}

Related

  1. formatDecimal(String format, double value)
  2. formatDecimals(double d, int mantissa)
  3. formatDecimals(double number)
  4. formatDecNumber(Double number, String pattern)
  5. formatDegToDms(double degrees, double min, double max)
  6. formatDistance(float distance)
  7. formatDollarAmount(float amount)
  8. formatDoube(double val)
  9. formatDouble(DecimalFormat fmt, double value)