Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.DecimalFormat;

public class Main {
    public static void main(String[] argv) throws Exception {

        DecimalFormat df = new DecimalFormat("#%");
        System.out.println(df.format(0.19));
        System.out.println(df.format(-0.19));
        System.out.println(df.format(-0.009));
        System.out.println(df.format(-12.009));
    }
}