public static String asString(
        final double[] A,
        int m,
        int n,
        int decimals
    ) {
        final StringBuilder out = new StringBuilder();
        final int      size     = m * n;
        final String[] elements = new String[size];
        //
        int max = 0;
        //
        for (int i = 0; i < size; i++) {
            elements[i] = DoubleTools.asString(A, i, 1, decimals);
            if (elements[i].length() > max) {
                max = elements[i].length();
            }
        }
        //
        final int celllength = max + VALUE_PADDING;
        //
        for (int i = 0; i < size; i++) {
            if ((i > 0) && ((i % n) == 0)) out.append("\n");
            //
            final String value = elements[i];
            final int diff = celllength - value.length();
            for (int j = 0; j < diff; j++) {
                out.append(" ");
            }
            out.append(value);
        }
        //
        return out.toString();
    }