Java Decimal Format toStringNoDigits(double[] v)

Here you can find the source of toStringNoDigits(double[] v)

Description

to String No Digits

License

Open Source License

Declaration

public final static String toStringNoDigits(double[] v) 

Method Source Code


//package com.java2s;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {
    public final static String toStringNoDigits(double[] v) {

        NumberFormat nf = new DecimalFormat("0");
        String res = "";
        for (int i = 0; i < v.length; i++) {
            res += (i > 0 ? "," : "") + nf.format(v[i]);
        }/*from   ww w . j av  a  2 s.c  o  m*/
        return res + "";
    }
}

Related

  1. toString(Double[] input)
  2. toString(double[][] a, int decimals)
  3. toString(final Double value)
  4. toString(final double value, final int maxDecimalPlaces)
  5. toStringForHumans(double doubleToConvert)
  6. toStringScientific(double x)
  7. trim(int degree, double d)
  8. trim(int level, double value)
  9. trim2Decimals(Double value)