Gagan Singh

Greenhorn
+ Follow
since Dec 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gagan Singh

Hi,
I m trying to make a method in which i want to format a fraction into percent format.
But i m unable to remove th errors in it.
If som1 can help me out...
below is the code i have written...

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.text.NumberFormat;

public class formating {

public static void main(String[] args) {

BigDecimal number = 8.375; // This is the value I want to format
public static final String DEFAULT_PERCENT_FORMAT = "#0.0#";


public String formatPercent(BigDecimal amount) { // Its showing syntax error here

DecimalFormat format = null;
format = new DecimalFormat(getProperty(DEFAULT_PERCENT_FORMAT));
return format.format(amt);
}

}
}
17 years ago
Hi,
I m trying to make a method in which i want to format a fraction into percent format.
But i m unable to remove th errors in it.
If som1 can help me out...
below is the code i have written...

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.text.NumberFormat;

public class formating {

public static void main(String[] args) {

BigDecimal number = 8.375; // This is the value I want to format
public static final String DEFAULT_PERCENT_FORMAT = "#0.0#";


public String formatPercent(BigDecimal amount) { // Its showing syntax error here

DecimalFormat format = null;
format = new DecimalFormat(getProperty(DEFAULT_PERCENT_FORMAT));
return format.format(amt);
}

}
}
17 years ago