DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Working with numbers

  1. #1
    Join Date
    Nov 2004
    Posts
    293

    Working with numbers

    I have a number that I calculated and is 0.0000000001374 I want to change this number to 1.374E-10 so I can put it in a string that way. How can I change the number to the value with exponent?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Dim D As Double
    Dim S As String

    D = 0.0000000001374
    S = Format$(D, "#.###E-")
    Last edited by Phil Weber; 02-14-2007 at 04:45 AM.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Phil;
    Dim X As double

    Is there a function that can understand the "E" automaticly ?
    I remember once a time I used something like that :
    //Not a code, an explication :
    a = instr(StrValue, "E")
    if (a+1) = "-" then number = value / val(mid(StrValue,a+1))
    else number = value * val(mid(StrValue,a))
    //--
    I mean can do the converse of the original question ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    ? Val("1.374E-10")
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Oooops .
    Thanks !
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Similar Threads

  1. Replies: 8
    Last Post: 06-19-2006, 05:05 AM
  2. Replies: 1
    Last Post: 05-31-2006, 02:14 AM
  3. ID Numbers are out of sequence
    By sensei in forum VB Classic
    Replies: 1
    Last Post: 05-18-2006, 01:25 PM
  4. Replies: 1
    Last Post: 08-13-2001, 03:24 AM
  5. VSS:sharing same working folder without multiple checkouts
    By rahul phatak rahulphatak in forum ASP.NET
    Replies: 0
    Last Post: 06-01-2000, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center