Uses the percentage format - Java Language Basics

Java examples for Language Basics:Number Format

Description

Uses the percentage format

Demo Code

import java.text.NumberFormat;

public class Main {
  public static void main(String[] args) {
    double grade = .92;
    NumberFormat pf = NumberFormat.getPercentInstance();
    System.out.println(pf.format(grade));
  }//www.  j a v a2 s . c  o  m

}

Related Tutorials