File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Percentage Calculation during XML import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Percentage Calculation during XML import" Watch "Percentage Calculation during XML import" New topic

Percentage Calculation during XML import

Gary Sheldon
Ranch Hand

Joined: Nov 21, 2011
Posts: 44
Hope someone can please help, I have a import process that parses an XML file and populates a database. The lines below simply read the relevant xml line and populate the test table and priceRrp field which is a decimal (10,2) with the appropriate data.

test.put("priceRrp", Subtotal3.item(i).getFirstChild().getNodeValue());;

I have however another field priceRrpVat again decimal (10,2) which I would like to carry out 10% reduction of the value Subtotal3.item(i).getFirstChild().getNodeValue() and store that in the field priceRrpVat. The problem is that the value is a string, so I need to convert the string, but I have tried till I am blue in the face but no joy.

Can someone can please help?
I agree. Here's the link:
subject: Percentage Calculation during XML import
It's not a secret anymore!