Here you can find the source of format(final double power)
public static String format(final double power)
//package com.java2s; public class Main { /**//w w w.j av a 2 s .c o m * @return Format result with 0 decimal places for bytes, or 1 for larger values */ public static String format(final double power) { return power == 0 ? "%.0f%s" : "%.1f%s"; } }