Java tutorial
//package com.java2s; import java.text.DecimalFormat; public class Main { public static double getSalesDone(String budget, String Sales) { DecimalFormat twoDForm = new DecimalFormat("#.##"); double bud = Double.parseDouble(budget); double sale = Double.parseDouble(Sales); double result = (sale / bud) * 100; result = Double.valueOf(twoDForm.format(result)); return result; } }