on 07-25-2007 6:31 AM
Hi All,
I have created a simple type of Double and binded it to the price attribute.
My aim is to diaplay only two digits after the decimal point.
I have given the format of the simple type as "#.##".
But it is showing even 10 digits after the decimal point.
Please help me with a solution.
Regards
Vivek.
I managed to attain that with the help of the forum. Thanks guys.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivekanandhan,
check this code.
DecimalFormat myformat = new DecimalFormat("0.00");
String fornatedNumber = myformat.format(wdContext.currentContextElement().getDecvar());
wdComponentAPI.getMessageManager().reportSuccess("Formated Number"+fornatedNumber);
or
String fornatedNumber =wdContext.currentContextElement().getDecvar().toString();
fornatedNumber = fornatedNumber.substring(0,fornatedNumber.length()-2)"."fornatedNumber.substring(fornatedNumber.length()-2);
wdComponentAPI.getMessageManager().reportSuccess("Formated Number : "+fornatedNumber);
http://www.javafaq.nu/java-article671.html
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
It shows all the digits when you entered. but when you raise an action it dispalys only the two decimal points.
try with this format #0.00
Regards,
Naga
Message was edited by:
Naga Raju Meesala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.