DecimalFormat SetMultiplier() Example
Sets the multiplier for use in percent, per mille,
DecimalFormatclass SetMultiplier() method example. This example shows you how to use SetMultiplier() method.This method Sets the multiplier for use in percent, per mille, and similar formats.
Here is the code:-
/**
* @Program that Sets the multiplier for use in percent,and similar formats
* SetMultiplier.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class SetMultiplier {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat();
//Gets the multiplier for use in percent,and similar formats
System.out.println("The multiplier for use in percent,and similar formats is: "
+ d.getMultiplier());
//Sets the multiplier for use in percent
d.setMultiplier(5);
System.out.println("The multiplier for use in percent,and similar formats is: "
+ d.getMultiplier());
}
} |
Output of the Program
The multiplier for use in percent,and similar formats is: 1
The multiplier for use in percent,and similar formats is: 5 |
|