Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String calcFatMass(Double bodyfat, Double weight_output) {
        return round((weight_output * (bodyfat / 100)), 1).toString();
    }

    public static Double round(double value, int precision) {
        int scale = (int) Math.pow(10, precision);
        return (double) Math.round(value * scale) / scale;
    }
}