Parsing double

Hello, I am new to Java and would appreciate a clue as to why the my output has garbage for the one double declared in Main. Any help would be appreciated.
import java.text.*;
import java.util.*;
import java.io.*;
import javax.swing.JOptionPane;
public class ymcaProject {
public static void main(String[] args) {
int count=-1;
int i;
double repAnswer;
double total=0.0;
String []fname = new String[100];
String []lname = new String[100];
int []memId = new int[100];
String []gender = new String[100];
int[] age = new int [100];
double [] Membership_fee = new double [100];
int[] Silver_sneaker_member = new int [100];
   start_program(fname,lname,memId,gender,age,Membership_fee,Silver_sneaker_member,count);
//Call to the menu method
  int menuAnswer=(int)Menu();
  while(menuAnswer !=4)
  if(menuAnswer==1)
    count=Modify_Member(fname,lname,count,memId,gender,age,Membership_fee,Silver_sneaker_member);
  if(menuAnswer==2)
    Modify_Enrollment();
  if(menuAnswer==3)
    Report(fname,lname,gender,memId,count,age,Membership_fee,Silver_sneaker_member,total);
  menuAnswer=(int)Menu();
  exit_program(fname,lname,memId,gender,age,Membership_fee,Silver_sneaker_member,count);
  System.exit(0);
  }//end of main method
    public static void start_program(String []fname,String []lname,int []memId,String []gender,
    int[] age, double[] Membership_fee,int[] Silver_sneaker_member,int count) {
     String newLine;
     try
          BufferedReader Member_file=new BufferedReader (new FileReader("member.dat"));
          int i;
          for (i=0; i<=count; ++i)
          while((newLine = Member_file.readLine()) !=null)
               StringTokenizer delimiter = new StringTokenizer(newLine,"#");
               count=count+1;
              fname[count]=delimiter.nextToken();
              lname[count]=delimiter.nextToken();
              memId[count]=Integer.parseInt(delimiter.nextToken());
              gender[count]=delimiter.nextToken();
              age[count]=Integer.parseInt(delimiter.nextToken());
              Membership_fee[count]=Double.parseDouble(delimiter.nextToken());
              Silver_sneaker_member[count]=Integer.parseInt(delimiter.nextToken());
     }//end while loop
          }//end for
     Member_file.close();
     }catch (IOException error)
     // there was an error on the file writing
     System.out.println("Error on file read " + error);
     }//error end
     }//end of start program member method
  //BEGINNING OF MENU METHOD
     public static double Menu(){
     double menuAnswer;
     String output = "The Pittsburgh YMCA"+
      "\n" +"1. Add/Modify Member Data";
     String menuDataString =JOptionPane.showInputDialog(
      "The Pittsburgh YMCA"+
      "\n"+
      "\n"+"1. Add/Modify Member Data"+
      "\n"+"2. Add/Modify Class Enrollments"+
      "\n"+"3. Report Section"+
      "\n"+"4. Exit the System"+
      "\n"+
      "\n"+"Please Make Your Selection>"+
      "\n");
     menuAnswer = Double.parseDouble(menuDataString);
    return menuAnswer;
     }//end of menu method
//beginning of Modify Member
     public static int Modify_Member(String[]fname,String[]lname,int count,
      int[] memId,String[]gender,int[]age, double[]Membership_fee,int[]Silver_sneaker_member)
     double menuQuestion=0;
      int modMember=0;
      String output = "";
     String menuDataString =JOptionPane.showInputDialog(
      "What do you wish to do?"+
      "\n"+
      "\n"+"1. Add a member?"+
      "\n"+"2. Modify a member?"+
      "\n"+"3. Delete a member?"+
      "\n"+
      "\n"+"Please Make Your Selection>"+
      "\n");
     menuQuestion = Double.parseDouble(menuDataString);     
     if(menuQuestion==1)
     int continueit=1;
     String svalue;
     String memAge;
     String sneakAns;
     String memberFee;
     while(continueit==1)
     count=count+1;
     fname[count]= JOptionPane.showInputDialog(null,
             "Enter First Name"," ",
      JOptionPane.QUESTION_MESSAGE);
      output="Enter Last Name";
      lname[count]=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      output="Enter 3 Digit ID";
      svalue=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      memId[count]=Integer.parseInt(svalue);
      output="Enter Gender M or F";
      gender[count]=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      output="Enter Age";
      memAge=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      age[count]=Integer.parseInt(memAge);
      output="Enter Membership Fee";
      memberFee=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      Membership_fee[count]=Double.parseDouble (memberFee);
      output="Silver Sneaker Member? 1=yes 2=no";
      sneakAns=JOptionPane.showInputDialog (null,
             output," ",
      JOptionPane.QUESTION_MESSAGE);
      Silver_sneaker_member[count]= Integer.parseInt(sneakAns);
      output="Enter 1 to continue, 0 to stop";
      svalue=JOptionPane.showInputDialog(null,
            output," ",JOptionPane.QUESTION_MESSAGE);
      continueit=Integer.parseInt (svalue);
      }//while loop
     }//end if
     if(menuQuestion==2)
     int i=0;
       String optionTwoDataString =JOptionPane.showInputDialog(
      "Please enter Member ID");
      modMember=Integer.parseInt(optionTwoDataString);
      if (modMember==memId)
     System.out.print(fname[i]+" "+lname[i]);
}//end Modify_member option 2 if statemet
}//end option 2 if from Modify_member method
return count;
}//end of modify member method
public static void Modify_Enrollment() {
     System.out.print("the Modify Enrollment menu has been called");
}//end of modify enrollment method
//REPORT METHOD
public static int Report(String []fname,String []lname,String[]gender,
int[]memId,int count,int[]age,double[]Membership_fee,int[]Silver_sneaker_member,double total)
int i;
double repAnswer=-1;
String ageAnswer;
String genderAns;
String M="";
int genAns;
int ageCount;
while (repAnswer !=10)
double reportMenu;
String repMenuString =JOptionPane.showInputDialog(
"REPORT MENU"+
"\n"+
"\n"+"1. All membership information"+
"\n"+"2. All Silver Sneaker members"+
"\n"+"3. All members above a specific age"+
"\n"+"4. Total membership fees paid"+
"\n"+"5. All male or female members"+
"\n"+"6. Report 6"+
"\n"+"7. Report 7"+
"\n"+"8. Report 8"+
"\n"+"9. Report 9"+
"\n"+"10. Exit Report Menu"+
"\n"+
"\n"+
"\n"+"Please make your selection >");
repAnswer = Double.parseDouble(repMenuString);
if(repAnswer==1)
for (i=0; i<=count; ++i)
System.out.println(fname[i]+" "+lname[i]+" "+memId[i]+" "+gender[i]+" "+age[i]+" "+
Membership_fee[i]+" "+Silver_sneaker_member[i]);
}//end for statement option 1
}//end if option 1
if(repAnswer==2)
for (i=0; i<=count; ++i)
if(Silver_sneaker_member[i]==1)
System.out.println (fname[i]+" "+lname[i]);
}//end if statement option two
if(repAnswer==3)
String output=" ";
output="Enter age cutoff";
ageAnswer=JOptionPane.showInputDialog (null,
output," ",
JOptionPane.QUESTION_MESSAGE);
ageCount=Integer.parseInt(ageAnswer);
for (i=0; i<=count; ++i)
if(age[i]>=ageCount)
System.out.println(fname[i] + " " +lname[i]);
}//end option 3
//begin option 4
if (repAnswer==4)
for (i=0; i<=count; ++i)
System.out.println("First Name"+" " +fname[i]+" "+"Last Name"+
" "+lname[i]+" "+"Fee"+" "+Membership_fee[i]);
total += Membership_fee[i];
}//end option 4
System.out.println( "Membership Fee Total: "+ total);
//begin option 5
if (repAnswer==5)
String output;
output="For Male Members 1 for Female Members 2";
genderAns= JOptionPane.showInputDialog (null,
output," ",
JOptionPane.QUESTION_MESSAGE);
genAns=Integer.parseInt(genderAns);
for (i=0; i<=count; ++i)
if (genAns==1)
for (i=0; i<=count; ++i)
if(gender[i].startsWith("M"))
System.out.println (fname[i]+" "+lname[i]);
if(genAns==2)
for (i=0; i<=count; ++i)
if(gender[i].startsWith("F"))
System.out.println(fname[i]+" "+lname[i]);
//end option 5
}//end while
return count;
}//end of Report method
//begin exit program method
public static void exit_program(String []fname,String []lname,int[]memId,String []gender,
int[] age, double[]Membership_fee,int[] Silver_sneaker_member,int count) {
     int i;
     for (i=0; i<=count; ++i)
     try
          BufferedWriter Member_file = new BufferedWriter(new FileWriter("member.dat"));
          for(i=0; i<=count; ++i)
          System.out.println(fname[i] + "#" + lname[i] + "#"+ memId[i] + "#" + gender[i] + "#" +
          age[i] + "#" + Membership_fee + "#" + Silver_sneaker_member[i]);
               Member_file.write(fname[i] + "#" + lname[i] + "#"+
          memId[i] + "#" + gender[i] + "#" + age[i] + "#" + Membership_fee + "#" +
          Silver_sneaker_member[i]);
               Member_file.newLine();
          }//end for loop
          Member_file.close();
     }//end of try
     catch (IOException error)
          System.out.println("Error on file write "+ error);
     }//end error
}//end of exit method
}//end of public class ymcaProject
Output is Ray#Cavender#111#M#40#[D@503429#1  between last and second to last is the Membership_id and is coming out as garbage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

System.out.println(fname[i] + "#" + lname[i] + "#"+ memId[i] + "#" + gender[i] + "#" +
            age[i] + "#" + Membership_fee + "#" + Silver_sneaker_member);
You probably want this to be:
System.out.println(fname[i] + "#" + lname[i] + "#"+ memId[i] + "#" + gender[i] + "#" +
            age[i] + "#" + Membership_fee[i] + "#" + Silver_sneaker_member);

Similar Messages

  • Parsing doubles with NumberFormat

    I have a little class called TextFieldDouble wich can display and parse double values. Depending on the default locale '.' or ',' is used for decimal separator and the opposite for grouping. I want to disable grouping because the user should get a parsing error when entering the wrong decimal separator. But java does not throw a ParseException in case of grouping disabled but truncates the string and returns a long. In case of trash after a number no exception is thrown, too.
    Here a little code that demonstrates my problem:
    public static void main(String[] args) {
    try {
    java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(java.util.Locale.US);
    System.out.println("With grouping:");
    System.out.println(f.parseObject("1.003").toString());
    System.out.println(f.parseObject("1,003").toString());
    System.out.println(f.parseObject("1ccc0").toString());
    System.out.println("Without grouping:");
    f.setGroupingUsed(false);
    System.out.println(f.parseObject("1.003").toString());
    System.out.println(f.parseObject("1,003").toString());
    System.out.println(f.parseObject("1ccc0").toString());
    catch (Exception e) {
    e.printStackTrace();
    The output is:
    With grouping
    1.003
    1003
    1
    Without grouping
    1.003
    1
    1
    But I want an exception in case of 1,003 when grouping disabled or in case of 1ccc3 anyway. Has anybody an idea?

    I'm having the same problem. Have you been able to fix it?
    Thanks.

  • Parsing Double numbers

    I am trying to write a program for some maths coursework,and I am having problems compiling it on my laptop,but I can compile it on the university unix machines!
    Specifically,the line of code that appears to be causing the trouble is the following line of code :-
    double number = Double.parseDouble(stdin.readLine());
    When ever I try and compile the program on my laptop (it's running Windows by the way),i get an error message,saying that it cannot resolve symbol,with the ^ pointing to the full stop,ie between "Double" and "parse".
    Any help in rectifying this problem would be greatly appreciated.
    Thanks very much.

    to compile my code I am just using the command javac
    through the comman line?
    I really cant undestand the problem!Well, unfortunately javac doesn't have a -version option (at least prior to the 1.5 / 5.0 version). But I heard that the newest version does. What does javac -version display? If it doesn't show a version number but instead says something like "invalid flag: -version", then I'd guess that the version of that tool is old. Did you really install the JDK and not just JRE? Or maybe you goofed up an installation and ended up with an old javac tool in your PATH ahead of the version that you want.

  • Problems parsing double quote

    I have been trying to figure out my problem for several hours, but still didn't get it. Hope to get an idea from you guys. My code is as follows:
    var astr;
    var outCr ="|";
    var outLf = "\u0000";
    var cr = "\n";
    var lf ="\r";
    var ddQuote=""";
    var dtQuote='\"';
    astr = "<%=firstDesc%>";
    astr.replace(outCr,cr);
    astr.replace(outLf,lf);
    astr.replace(ddQuote, dtQuote);
    while (astr.indexOf(outCr) > 0) {
    z = astr.indexOf(outCr);
    astr = astr.substring(0, z) + cr + astr.substring(z+1,astr.length );
    while (astr.indexOf(outLf) > 0) {
    z = astr.indexOf(outLf);
    astr = astr.substring(0, z) + lf + astr.substring(z+1,astr.length );
    while (astr.indexOf(ddQuote) > 0) {
    z = astr.indexOf(ddQuote);
    astr = astr.substring(0, z) dtQuote astr.substring(z+1,astr.length );
    document.form1.description.value=astr;
    The value of firstDesc is a very big string from the database that contains carriage return, linefeed, single quote and double quote. It needs to be displayed in a HTML text area. Now everything works fine except the double quote. A firstDesc value containing double quote will not appear in the text area, and it even stop my jsp page and disable other buttons. But if I get rid of the code handling the double quote, everything works fine. What's the problem?

    maybe you should ask this question in a JavaScript forum.

  • How to parse Double to Integer Type?

    Dear all,
    I have a question in Java programming. How to change the variable of Double type into Integer Type? Is there any class that I should import in the Program?
    thanks.

    Double d = new Double(2.0);
    Integer i = new Integer(d.intValue()));

  • Possible to read input directly to double?

    i know how to parse double/ int and all that stuff from a string,
    but i was wondering (for future reference) if there is a quicker way to just go from input to double.
    i know this way
    string1 = stdin.readLine( );
    int1 = Integer.parseInt (string1);

    Have a look at the Double class:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html

  • Double.parseDouble help?

    I have this String Number 20.000. When I do a parseDouble I get 20.0 which is right.
    public class qwerty {
         public static void main(String[] args) {
              String num = "20.000";
              System.out.println(Double.parseDouble(num));
    But is there a way to preserve the zeroes and it prints 20.000 itself after parse Double?

    But is there a way to preserve the zeroes and it prints 20.000 itself after parse Double?Not directly. Doubles (and doubles, and all other Number subclasses and number primitives) store only information about the value of the number, not how it is to be displayed.
    As mentioned, you'll need to use formatting provided either by a DecimalFormat object or a printf() function. To do what you're asking, you'd need to somehow parse the input string to determine the required format, and store that information separately (e.g. in a String or a DecimalFormat object), then use that whenever you want to display the number. Check out the documentation for DecimalFormat and PrintStream.printf().
    Regex would probably be helpful if you decide to go that route.

  • Formating a double

    Hello!
    I have nr i double like this.. 1.2345
    now I want only two digit accuracy, ie 1.23 and i want it correctly roundned. How do I do this. Ive tried with DecimalNumberFormat but get the answer in 1,23 wich is no good..because i cannot turn it back to a double.
    Best Regards
    Daniel

    If you want to have '.' as decimal separator use Locale.US
    You can also use the DecimalFormat and pass the Constructor
    the DecimalFormatSymbols to be used.
    For parsing string use the parse method of NumberFormat.
    it uses the correct DecimalFormatSymbols when the string is parsed.
    double d = 1.2345d;
    double parsedValue;
    NumberFormat myFormat= NumberFormat.getInstance(Locale.US);
    myFormat.setMimimumFractionDigits(2);
    myFormat.setMaximumFractionDigits(2);
    System.out.println(myFormat.format(d));
    parsedValue = myFormat.parse( myFormat.format(d) ).doubleValue();

  • Public class SodaCan{ etc

    Here is the link to ANOTHER student + 'pls do my hwk Q/' and clearly a beginner who wanted to do a bit of comp calc/maths
    http://forum.java.sun.com/thread.jsp?forum=54&thread=301814
    Flame me if you will ... BUT:
    but it seemed to be a VERY MESSY way to teach java. If it were me then I would show them ...something like this firstmain() {
    declare doubles ddVOL, ddSURF;
    parse doubles x, y;
    ddVOL = Math.PI(formula with x, y);
    ddSURF = Math.PI(formula with x, y);
    DecimalFormat method();
    S.o.println(for ddVOL and ddSURF);
    } and cls
    ~ 8 lines, or so, of actual code.From what I saw of the code the student did paste, I don't think she or he has been taught how to do the above or could do the above - sorry, NOT just the indidividual - maybe the whole class (an assumtion). So to my questions:
    Why start with such laborious java, surely this is confusing for a beginner?
    This sort of procedural coding (see link pls), for me, came MUCH later. I just started implementing it without being aware of it and if you are to be a programmer, then this is what you do (I think ...). There are at least 4 types of student;-
    ONE: losers (forget them)
    TWO: They just want to get through the course and the 'scrape through' well we've met them here regularly enough (forget those ones)
    THREE: You pass, you do OK and in your work you need to implement and adapt a bit of script now and again, then I don't think the SodaCan would have helped you in any way.
    FOUR: and if you have any sort of interest or aptitude (or BOTH preferably), then you'll go on to be programmer of sorts and sooner or later you will return variables from your constructors/functions whether a boring lecturer confuses the hell out of you in the first few weeks of the course or not.
    Isn't there an argument for keeping it simpler than this ... or have I just lost the plot somewhere?
    (this is from a former teacher btw, so I am on the side of the confused student - IF they approach the question in the right way)

    Back to the original point, I agree that having a bunch of void methods doesn't really make much sense, but I think also that nearly every introductory text does this. Perhaps to make "engaging" examples such as RoachPopulation. But you're right, there's no excuse since returning references from methods isn't really significantly more advanced than what they're trying to do (arguably it's easier to grasp).
    To be honest, I really liked the concept of the RoachPopulation class, so I tried it out (I'm learning Java too, after all). I was pleased that I didn't make too many mistakes, one notable one is that the wait() method, which is a final method of java.lang.Object, isn't overrideable. So I renamed it, but you would think that the teacher would have known this...
    class RoachPopulation {
        int numRoaches;
        // constructor -- feed num of roaches as arg
        public RoachPopulation(int numRoaches) {
            this.numRoaches = numRoaches;
        // wait -- the roach population doubles!
        // a better name would be "populationDoubles", in fact
        // when I tried to compile this program, the compiler warned me that
        // wait() cannot be overridden from java.lang.Object !!
        public void populationDoubles() {
            this.numRoaches = this.numRoaches * 2;
        // spray -- kill some roaches
        // this should really be called "beSprayed"
        public void spray() {
            this.numRoaches = (int) (this.numRoaches * 0.9);
        // getRoaches -- how many are there?
        public int getRoaches() {
            return this.numRoaches;
        // main
        public static void main(String[] args) {
            // start a new roach family
            RoachPopulation roachmotel = new RoachPopulation(10);
            // loop three times
            for (int i = 0; i < 3; i++) {
                // breed!!
                roachmotel.populationDoubles();
                // attack!!
                roachmotel.spray();
                // survey the damage
                int numRoaches = roachmotel.getRoaches();
                // battle report
                System.out.println("Number of roaches after iteration "
                                    + i + ": " + roachmotel.getRoaches());
            if (roachmotel.getRoaches() > 10) {
                System.out.println("\n\n\nTHERE'S NO STOPPING THEM!!!");
    }

  • Master Collection CS6 installation error

    Hi, I just installed CS6 on my computer and this came up.
    - 0 fatal error(s), 3 error(s), 2 warning(s)
    WARNING: DW065: Display requirements not met for {E8AD3069-9EB7-4BA8-8BFE-83F4E69355C0} CS6 Master Collection 6.0.0.0
    WARNING: DW066: OS requirements not met for {AC76BA86-1033-F400-7760-000000000005} Acrobat Professional 10.0.0.0
    ----------- Payload: {AC76BA86-1033-F400-7760-000000000005} Acrobat Professional 10.0.0.0 -----------
    ERROR: Error 1324.The path R嶰up廨er un document num廨is?sur un multifonction.sequ or the volume is invalid. Please enter it again.
    ERROR: Install MSI payload failed with error: 1603 - Fatal error during installation.
    MSI Error message: Error 1324.The path R嶰up廨er un document num廨is?sur un multifonction.sequ or the volume is invalid. Please enter it again.
    ERROR: DW050: The following payload errors were found during install:
    ERROR: DW050:  - Acrobat Professional: Install failed
    As a result I can't install Acrobat.
    I googled a bit but to no avail.
    My computer is Win 7 64 Home Premium.
    I suspect it's related to localisation but I don't know how I can resolve that. I set my computer to HK locale but English (UK).
    Can anyone help?

    I suspect it's related to localisation
    Not really. It's pretty clear:
    WARNING: DW065: Display requirements not met for {E8AD3069-9EB7-4BA8-8BFE-83F4E69355C0} CS6 Master Collection 6.0.0.0
    WARNING: DW066: OS requirements not met for {AC76BA86-1033-F400-7760-000000000005} Acrobat Professional 10.0.0.0
    You are using too small a screen with a not properly updated operating system. Sorry, but under those conditions this will never work. Of course the language mismatch does contribute since English installers cannot find certain directories under different names or cannot parse double-byte file and folder names...
    Mylenium

  • Double.parseDouble(String) : Problem to parse large String

    Hello,
    I need to convert A String to a Double in my application without rounding of digits.
    I have used the Double.parseDouble(String) method.
    The maximum string length can be 17 including dot(.)
    So if my String is (of length 17)
    Eg.
    S= �9999999999.999999� then I am getting the double value as
    d= 9999999999.999998(compare the last digit)
    If s = �9999999999.111111� then d = 9999999999.111110
    If s = �9999999999.555555� then d = 9999999999.555555 (result that I want)
    If s = �9999999999.666666� then d = 9999999999.666666 (result that I want)
    If s = �9999999999.777777� then d = 9999999999.777777 (result that I want)
    If s = �9999999999.888888� then d = 9999999999.888887
    If s = �9999999999.999999� then d = 9999999999.999998
    If s = �9123456789.123456� then d = 9123456789.123456
    But string length up to 16 is giving me the accurate result
    So any body can explain me that why it is happening? And how can i get the accurate result.
    Thanks in advanced.

    Hi,
    Thank You for your suggestion. By which i can store
    the big double number in Data base , but at some
    point i require to parse a double value from a Double
    reference.In that case if the Decimal value length
    => 16 then it the last digit changes or rounds.
    coverting 9999999999.999999 Decimal value to double
    value. It gives me 9999999999.999998 and
    9999999999.9999999 gives me the 10000000000.0000000.
    but the Double value 999999999.999999 is ok
    and 999999999.99999999 rounds.Err, is there a follow up question in there?

  • Does Oracle XML Parser support double byte charset?

    Hi,
    Does Oracle XML Parser support double byte characters such as Korean or Chinese? If so, please tell me what version and how to construct xml/xsl files (...encoding="???")?
    Thanks for any help,
    Tuan

    Hi Raymond,
    Thank you for your help. It worked when I running in JDeveloper with your posted code. However, when I tried in my real application, it won't work.
    The problem is for localization purposes, my application using some texts display in browsers are saved in Unicode file. Later, application runs and depends on languages setting in browsers, with JavaServlet retrieves those texts and saves in formated xml StringBuffer. Then, using existed XSL Stylesheet file and OracleXMLParser to generate an output HTML.
    It has worked fine with English, France or others (single byte characters), but it can't
    for double bytes character such as Korean or Chinese. I also tried different charset in xml file.
    The following is one of returning errors:
    -- oracle.xml.parser.v2.XSLException: XSL-1004: Error while parsing input XML document (<Line 1, Column 552>: XML-0221: (Fatal Error) Invalid char in text.)
    I run this app in win2000/IIS with ServletExec3.0, JDK1.2.2 and OracleXMLParser v2.0.2.10
    Thank you for any helps,
    Tuan
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Raymond Hayes Jr ([email protected]):
    Nothing fancy 'cause I'm half asleep but I used your xml/xsl and it seemed to work. No errors anyway. This is what I put together in JDeveloper 3.2
    package demo;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    public class CuriosityKilledTheCat extends HttpServlet {
    * Initialize global variables
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    * Service the request
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try
    XSLStylesheet xsl = new XSLStylesheet( new URL ("file:///c:\\temp\\input.xsl") , null );
    XSLProcessor xp = new XSLProcessor();
    XMLDocument xd = new XMLDocument ();
    XMLDocumentFragment xf = new XMLDocumentFragment();
    xf = xp.processXSL ( xsl , new URL ( "file:///c:\\temp\\input.xml") , null );
    System.out.println ( "here" );
    xd.appendChild( xf );
    xd.print ( response.getOutputStream() );
    catch ( Exception e )
    System.out.println ( e.getMessage() );
    * Get Servlet information
    * @return java.lang.String
    public String getServletInfo() {
    return "demo.CuriosityKilledTheCat Information";
    }<HR></BLOCKQUOTE>
    null

  • Parse a line of string to double

    Hi all:
    I have a file that contains a matrix of double values, and I need to parse each of this value and store them in double format. Each line in the file contains the same number of values, and each value within a line is seperated by a space character. Currently, what I am thinking is first read in a line, then use regular expression to find matches one by one, then parse each of the matched string to double using Double.valueof(String string). I wonder is there any better method to do this?

    Use String.split() with a whitespace regex, and then parse each result.

  • Double parsing and significant digits

    Does anyone know why I am getting extra significant digits from the parse methods and how I get around this problem?
    Code:
    double value = Double.parseDouble("12398.7");
    System.out.println("double="+value);
    value = value/100.0;
    System.out.println("double/100.0="+value);
    double fvalue = Float.parseFloat("12398.7");
    System.out.println("float="+fvalue);
    fvalue = fvalue/100.0;
    System.out.println("float/100.0="+fvalue);
    Output:
    double=12398.7
    double/100.0=123.98700000000001
    float=12398.7001953125
    float/100.0=123.987001953125
    Here�s what I wanted:
    double=12398.7
    double/100.0=123.987
    float=12398.7
    float/100.0=123.987

    Does anyone know why I am getting extra significant
    digits from the parse methods and how I get around
    this problem?Yes, many people know why you are getting extra digits and how to get around this problem. See the thread titled "Why ?? 0.4 + 0.3 + 0.3 = 0.9999999999999999", or any of hundreds of other threads about binary math.

  • Parsing the integer/ double values

    Hai Guys,
    I am writing a code in java for my work,
    The problem i am facing:
    "System.out.println("temp_predictions,instances.instance(i) " +temp_predictions[i]+ " \t" + instances.instance(i))
    prints the results as this
    {code}
    temp_predictions[i],instances.instance(i) [D@186c6b   21,1
    {code}
    i need to have the original value of [D@186c6b
    . how can i convert to integer or double ?
    {code} private double evaluatePredictions(Instances instances,double[][] temp_predictions, int metric) throws Exception {
    Evaluation eval = new Evaluation(instances);
    for (int i = 0; i < instances.numInstances(); ++i) {
    eval.evaluateModelOnceAndRecordPrediction(temp_predictions[i],instances.instance(i));
    System.out.println("temp_predictions[i],instances.instance(i) " +temp_predictions[i]+ instances.instance(i));
    System.out.println("EnsembleMetricHelper.getMetric(eval, metric) " +EnsembleMetricHelper.getMetric(eval, metric));
    return EnsembleMetricHelper.getMetric(eval, metric);
    }{code}
    Edited by: svpriyan00 on Nov 3, 2009 2:47 PM

    Eh? temp_predictions is an array of an array of doubles. Your code is printing out one of those arrays of Doubles. What you're seeing in your output is what an array of doubles prints as.
    If you already have an array of doubles, there's no parsing that needs to be done. Just array indexing.
    You say you want to convert to an integer or double. You have an array of doubles and want to have just one double. That doesn't really make sense. There are a lot of ways you could get a single double from an array. You could just take the first one. Or the last one. Or add them all up. Or take the average.
    What exactly are you trying to accomplish?

Maybe you are looking for

  • ASSIGN_TYPE_CONFLICT

    I am getting a fatal error short-dump ASSIGN_TYPE_CONFLICT while executing DTP---  0CO_OM_WBS_6 -> ODS_01. I have checked all the mappings. All are correct. Even I kept only 2 characterstics and one key figure (that is also constant value), but i got

  • Expanding Quicksilver used for internet - is it worth it?

    I still have my trusty old G4 Quicksilver. It's now used by my 6 year old for the internet. The only thing I've done to it over the yeas is give it extra memory - it currently has 1.12GB. Also replaced the CD drive for a DVD drive. It has a tiny inte

  • Recently Edited Files not Showing in Organiser PSE11

    My recently edited files do not show in the editor.  All the repairs, optimise etc have been done.  Photos have been saved as Jpeg and PSD and the check box to save in Organiser also ticked. Timeline does not show anything saved today and untagged me

  • VPRS in Intercompany Sales Order

    Hello everyone, We have a scenario in our company as follows: We are implementing Inter-company Sales in our environment. Sales Org 1 (ccode1) sells goods belonging to Plant 2 (ccode2). Later the ccode 2 cross charges ccode 1 via Inter Company Invoic

  • Need different price for sales order and billing document.

    Hi,      I'm having a scenario.I have created a sales order for a material,the order value is $100.I have done up to Delivery.Billing part is only remaining in the flow.Unexpectedly the price of the material increases $20 more.Customer is ok with the