Results 1 to 6 of 6

Thread: Display 16 digit numbers without scientific notation

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    2

    Question Display 16 digit numbers without scientific notation

    Does anyone know how to display 16 digit numbers without scientific notation?

    Now I have this:

    dim rt = 4444555544446666
    response.write (rt & "<br>")
    rt = ((rt-1111333)^.5)/66
    response.write (rt & "<br>")
    rt = (( (rt*66)^2)+1111333 )
    response.write (rt & "<br>")

    and I get:

    4444555544446666
    1010113.63489608
    4.44455554444667E+15

    I need to diplay '4.44455554444667E+15' without scientific notation which is: '4444555544446666'

    Any help greatly appreciated!

  2. #2
    Hyperactive Member
    Join Date
    Jul 2004
    Location
    Kansas, USA
    Posts
    352

    Re: Display 16 digit numbers without scientific notation

    HOw did you solve this?
    Thanks,
    Eric
    --------------------------------------------------------------------------------------------------------------------
    VB.net/C# ... Visual Studio 2019
    "None of us are as smart as all of us."

  3. #3
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Display 16 digit numbers without scientific notation

    you need it to become a string, however getting it to the string could be an issue in itself... if you are willing to suffer some data loss you could get it to work, eg string = (rt / 100000000000000) & "00000000000000"

    but this would sort of defeat the purpose so u need to figure out a way to get the rest.. however perhaps you could then do this

    string1 = clng(rt / 100000000000000) & "0000000000000"
    double1 = rt - double.parse(string1)
    string2 = clng(rt / 100000000000000) & double1

    that might work for you, let me know how it goes

  4. #4
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Display 16 digit numbers without scientific notation

    actually clng rounds up, so ull need to make ur own function to do the cutting without rounding. unless ther is one already?

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Display 16 digit numbers without scientific notation

    The Decimal type does not use scientific notation when converted to a string, e.g. for displaying on-screen.

    Also, this:
    VB Code:
    1. dim rt = 4444555544446666
    is late binding. I hope you don't do that in your real code.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Display 16 digit numbers without scientific notation

    Decimal displays full digits? that's alright :P

    tell you what, it's little things like that you pickup from messing on forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width