Here you can find the source of roundAlloc(Double alloc)
public static String roundAlloc(Double alloc)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String roundAlloc(Double alloc) { return new DecimalFormat("#.#").format(alloc); }//from ww w .j a va 2 s. com }