I have to apply a format to my currency value.
The currency i have is-->
1402000
15000
10000 and so on.
I want to display it as--->
14,02,000
15,000
10,000
What i've done is,
[CODE=java]
String value = mfobj.getTotalC ost();//getting the value
int i = Integer.valueOf (value).intValu e();//converting to int
Locale india = new Locale("en","IN ");//custom locale
NumberFormat nf = NumberFormat.ge tInstance(india );
DecimalFormat df = (DecimalFormat) nf;//instantiate a NumFormat ,cast it to DecimalFormat
df.applyPattern ("##,##,###" );//pattern applying
//String output = df.format(i);
//Currency curr = Currency.getIns tance(india);
display it as <%=df.format( i) %>
[/CODE]
the values im getting is
1,402,000
15,000
10,000
How can i achieve the above combination?
Regards,
ajos
The currency i have is-->
1402000
15000
10000 and so on.
I want to display it as--->
14,02,000
15,000
10,000
What i've done is,
[CODE=java]
String value = mfobj.getTotalC ost();//getting the value
int i = Integer.valueOf (value).intValu e();//converting to int
Locale india = new Locale("en","IN ");//custom locale
NumberFormat nf = NumberFormat.ge tInstance(india );
DecimalFormat df = (DecimalFormat) nf;//instantiate a NumFormat ,cast it to DecimalFormat
df.applyPattern ("##,##,###" );//pattern applying
//String output = df.format(i);
//Currency curr = Currency.getIns tance(india);
display it as <%=df.format( i) %>
[/CODE]
the values im getting is
1,402,000
15,000
10,000
How can i achieve the above combination?
Regards,
ajos
Comment