Java Float Array to String floatArrayToString(String tag, float[] arr)

Here you can find the source of floatArrayToString(String tag, float[] arr)

Description

float Array To String

License

Open Source License

Declaration

public static String floatArrayToString(String tag, float[] arr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String floatArrayToString(String tag, float[] arr) {
        StringBuilder builder = new StringBuilder();
        if (tag != null) {
            builder.append("\"" + tag + "\"" + ":");
        }//  w  w w . ja va 2  s.c o m
        builder.append("[");
        for (int i = 0, len = arr.length; i < len - 1; i++)
            builder.append(arr[i] + ",");
        if (arr.length > 0)
            builder.append(arr[arr.length - 1]);
        builder.append("]");
        return builder.toString();
    }
}

Related

  1. floatArrayToString(final float[] floatArray)
  2. floatArrayToString(float[] array)
  3. floats2strs(float[] fs)