Java Collection Join roundjoin(Collection s, String delimiter)

Here you can find the source of roundjoin(Collection s, String delimiter)

Description

roundjoin

License

Open Source License

Declaration

public static String roundjoin(Collection s, String delimiter) 

Method Source Code


//package com.java2s;
//    it under the terms of the GNU General Public License as published by

import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static String roundjoin(Collection s, String delimiter) {
        StringBuffer buffer = new StringBuffer();
        Iterator iter = s.iterator();
        while (iter.hasNext()) {
            buffer.append(String.valueOf(Math.round(328.084 * ((Double) iter.next())) / 100.00));
            if (iter.hasNext()) {
                buffer.append(delimiter);
            }/*from   w w  w  .j  a  v  a  2 s.  c  o m*/
        }
        return buffer.toString();
    }
}

Related

  1. joinStringValues(Collection values)
  2. joinTo(Collection data, String sep, StringBuilder sb)
  3. joinTogether(Collection items, String delim)
  4. joinToStringBuilder(Collection collection, String separator)
  5. joinValues(Collection values, String separator)
  6. stringJoin(Collection list, String delim)
  7. stringJoin(java.util.Collection s, String delimiter)

  8. HOME | Copyright © www.java2s.com 2016