Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

How to covert String("6,400.0") to Double ?

Thread view: 
moon_ils-se@yahoo.com.hk - 28 Jul 2005 09:07 GMT
 public static double removePeriod(String format) {
 double a = 23.0;
  format = "23.0";
  a = Double.parseDouble(format,10);
  return a;
 }
Thomas Weidenfeller - 28 Jul 2005 10:38 GMT
>   public static double removePeriod(String format) {
>   double a = 23.0;
>    format = "23.0";
>    a = Double.parseDouble(format,10);
>    return a;
>   }

Is that supposed to be a question?

May I recommend that you read

    http://www.yoda.arachsys.com/java/newsgroups.html

and
    http://www.catb.org/~esr/faqs/smart-questions.html

particular

    http://www.catb.org/~esr/faqs/smart-questions.html#beprecise

and follow that advice prior to posting?

You might also want to consider posting to comp.lang.java.help instead.
But also, read and follow the above advice before posting here ore there.

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Roedy Green - 28 Jul 2005 11:58 GMT
>  double a = 23.0;
>   format = "23.0";
>   a = Double.parseDouble(format,10);
>   return a;
>  }
for all your conversion problems consult
http://mindprod.com/applets/converter.html

Signature

Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes

moon_ils-se@yahoo.com.hk - 29 Jul 2005 03:40 GMT
test_double.java:10: Method parseDouble(java.lang.String) not found in class
jav
a.lang.Double.
   t = Double.parseDouble("-12000.001");

Compile error on java version "1.1.3". it is ok on java version

> >  double a = 23.0;
> >   format = "23.0";
[quoted text clipped - 11 lines]
> Canadian Mind Products, Roedy Green.
> See http://mindprod.com/iraq.html photos of Bush's war crimes
Andrew Thompson - 29 Jul 2005 06:48 GMT
> test_double.java:10: Method parseDouble(java.lang.String) not found in class
> jav
> a.lang.Double.
>     t = Double.parseDouble("-12000.001");
>
> Compile error on java version "1.1.3".

Yes.  Double.parseDouble(String) was introduced in 1.2.

Where on Earth did you get a 1.1.3 SDK from?

( And why on Earth are you *using* it? )

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
It's Like "Hee Haw" With Lasers



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.