Formula to format Result - Android java.lang

Android examples for java.lang:Math Formula

Description

Formula to format Result

Demo Code


//package com.java2s;
import java.text.DecimalFormat;

public class Main {
    public static String formatResult(double result) {
        DecimalFormat fourDForm = new DecimalFormat("#0.0000");
        String resultFormated = fourDForm.format(result);
        return resultFormated;
    }/*from   ww w.j  av  a2s  .  c om*/
}

Related Tutorials