[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 833
  • Last Modified:

How do I convert this exponential number?

I have this number -1.34152189427569E+34 that I am trying to convert into a number I can use, but with the code below I just get it as a double, with the exponent on the end. I tried converting it to a decimal number type, but no dice. Help!

Dim a As Double
        Dim num As String
        Dim conv As Double

        readcffile(1, 0) ' ignore
        a = calculate(8520322, 6457197, 1, 0) ' ignore
        num = a.ToString
        TextBox1.Text = num

        conv = Double.Parse(num, Globalization.NumberStyles.Float)


1 Solution
Mike TomlinsonMiddle School Assistant TeacherCommented:
Like this?...

        Dim strNum As String = "-1.34152189427569E+34"
        Dim dbl As Double = Double.Parse(strNum)
        Dim strDbl As String = dbl.ToString("n")
        MsgBox(dbl.ToString & " = " & strDbl)

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now