Here you can find the source of formatSize(double size)
Parameter | Description |
---|---|
size | the value to format |
static public String formatSize(double size)
//package com.java2s; /**//from w w w . ja va2 s . c o m * * $Id: Utils.java 28 2005-06-20 13:13:35Z rej $ * * Copyright (c) 2002 Sun Microsystems, Inc. * * * * See the file "license.terms" for information on usage and redistribution * * of this file, and for a DISCLAIMER OF ALL WARRANTIES. **/ import java.text.NumberFormat; public class Main { static private NumberFormat longSizeFormatter; static private NumberFormat doubleSizeFormatter; /** * Format as a size * @param size the value to format * @return the formatted value */ static public String formatSize(long size) { return longSizeFormatter.format(size); } /** * Format as a size * @param size the value to format * @return the formatted value */ static public String formatSize(double size) { return doubleSizeFormatter.format(size); } }