Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;

    }
}