Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.NumberFormat;

public class Main {
    public static String getMatchingThresholdToString(int value) {
        double p = -value / 12.0;
        NumberFormat nf = NumberFormat.getPercentInstance();
        nf.setMaximumFractionDigits(Math.max(0, (int) Math.ceil(-p) - 2));
        nf.setMinimumIntegerDigits(1);
        return nf.format(Math.pow(10, p));
    }
}