This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Percentage Calculation during XML import" Watch "Percentage Calculation during XML import" New topic
Author

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());
test.save();

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: http://aspose.com/file-tools
 
subject: Percentage Calculation during XML import