Codejava's Posts
Nairaland Forum › Codejava's Profile › Codejava's Posts
1 (of 1 pages)
Thanks segsalerty, I looked at your code is ok but i still have a challenge, 'am populating MySql db from text file. I quite can upload the data using buffer, but I made the amount column to be string, so i just want the module of the amount to be converted back to double rather than doing it manually b4 uploading. I still find it difficult to modified or apply your code. |
can somebody help me to fine tone this code, i set it as string but i want to cast string to double, when storing those string: String txt = null; String line = null; ApplicationData app = new ApplicationData(); String[] splits = txt.split("\t" ;String amt = "0"; if (length > 3 && !splits[3].equals("" ) {amt = splits[3].trim(); amt = splits[3].replace('-',',').replace('"',',').replace('(',',').replace(')',','); String actSplit[] = amt.split("," ;for(int z = 0; z < actSplit.length; z++){ amount += actSplit[z]; } } app.setAmount(amount); my main concern is that, I want the values which i uploaded to return back in double. I think i can cast using Double.valueOf(amt); but is not working. Kindly help pls |
If you can train somebody on Java Developer, try to contact me tru this email dotun.daniel@yahoo.com |
1 (of 1 pages)
;