Java Decimal Format printArrayP(double[][] p)

Here you can find the source of printArrayP(double[][] p)

Description

print Array P

License

Apache License

Declaration

public static void printArrayP(double[][] p) 

Method Source Code


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

import java.text.DecimalFormat;

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

    public static void printArrayP(double[][] p) {

        for (int i = 0; i < p.length; i++) {
            for (int j = 0; j < p[i].length; j++) {
                System.out.print(df.format(p[i][j]));
                // System.out.print(df.format(p[i][j])+" , ");
                if (!(j + 1 == p[i].length)) {
                    System.out.print(" , ");
                }/*from w  w w  . j a  v  a  2s. co  m*/
            }
            System.out.println("");
        }
        System.out.println("");

    }

    public static void printArrayP(int[][] p) {

        for (int i = 0; i < p.length; i++) {
            for (int j = 0; j < p[i].length; j++) {
                System.out.print(df.format(p[i][j]));
                // System.out.print(df.format(p[i][j])+" , ");
                if (!(j + 1 == p[i].length)) {
                    System.out.print(" , ");
                }
            }
            System.out.println("");
        }
        System.out.println("");

    }
}

Related

  1. prettyPrintLatLon(double coord, boolean isCoordKindLat)
  2. print(double[] y)
  3. printAlpha(double a[])
  4. printAngle(double angle)
  5. printArray(String title, double[] vect)
  6. PrintWith1DecAnd000Sep(double Number)
  7. randomDouble(double minDouble, double maxDouble)
  8. randomGenLat(Double latstart, Double latend)
  9. randomGenLngLat(Double lngstart, Double lngend, Double latstart, Double latend)