Results 1 to 1 of 1
- 07-02-2008, 12:59 PM #1
Member
- Join Date
- May 2008
- Posts
- 69
- Rep Power
- 0
Struts 1.x <bean:write format="0.00%"> help?
Hi Members,
This issue is very urgent;
Im using <bean:write format="0.00%"> tag for displaying numbers in percentage format, but when i total all my values its showing as "100.01%" but i need it to be rounded of to "100%";
There is some logic in doing this:
For Eg: 43.567 = 43.56% (here the number after two decimal point is > than 5 and the number before is (6) a EVEN number '.567' so we can leave it as such)
43.576 = 43.58% (here the number after two decimal places is > than 5 and the number before is (7) which is a odd number '.576' so we can add one number to it and it can 43.58%
How to use this logic in 'FORMAT' tag of <bean:write>
Looking forward for early reply.
Thanks and Regards,
Prabhu.
Similar Threads
-
Hwlp with "Open", "Save", "Save as..."
By trill in forum New To JavaReplies: 3Last Post: 11-02-2010, 09:26 AM -
[SOLVED] Exception in thread "main" java.util.NoSuchElementException
By thevoice in forum New To JavaReplies: 5Last Post: 05-14-2008, 01:43 PM -
"Jumble" or "Scramble" Program
By Shadow22202 in forum Java AppletsReplies: 8Last Post: 04-30-2008, 03:42 AM -
ArrayList: Exception in thread "main" java.lang.NullPointerException
By susan in forum New To JavaReplies: 1Last Post: 07-16-2007, 06:32 AM -
Struts tag error with bean:write
By sandor in forum Web FrameworksReplies: 1Last Post: 04-07-2007, 04:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks