File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Percentage Calculation during XML import

 
Gary Sheldon
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic