Here you can find the source of formatCPUUtilization(double d)
public static String formatCPUUtilization(double d)
//package com.java2s; /*/*from w ww . j a v a 2 s . c o m*/ * Copyright (c) Fiorano Software and affiliates. All rights reserved. http://www.fiorano.com * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ import java.text.DecimalFormat; public class Main { public static String formatCPUUtilization(double d) { DecimalFormat decimalFormat = new DecimalFormat("0.00"); if (d < 0) { return "NA"; } else { return decimalFormat.format(d * 100).replace(",", "."); } } }