Java Fraction Format format(double num, String pattern)

Here you can find the source of format(double num, String pattern)

Description

format

License

Apache License

Declaration

public static String format(double num, String pattern) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DecimalFormat;

public class Main {
    public static String format(double num, String pattern) {
        DecimalFormat doubleFormat = new DecimalFormat(pattern);
        String resultStr = doubleFormat.format(num);

        return resultStr;
    }//from  w  w  w  . ja v a 2s .co  m
}

Related

  1. format(double no, String formatter)
  2. format(Double num)
  3. format(Double num)
  4. format(double num)
  5. format(double num, int n)
  6. format(double number)
  7. format(double number)
  8. format(double number)
  9. format(double number, int digits)