Concatenating A Double

Discussion in 'ASP .Net' started by Ron, Jul 2, 2003.

  1. Ron

    Ron Guest

    Can anyone tell me how I can remove a few zero's from the end of a double?

    For example, the number I have is 55.0000, the number I need is 55.00.

    How can I go about trimming the zeros?

    Thanks,

    Ron
     
    Ron, Jul 2, 2003
    #1
    1. Advertisements

  2. Steve C. Orr, MCSD, Jul 2, 2003
    #2
    1. Advertisements

  3. Dim dblValue As Double = 55.0000

    Convert.ToDecimal(dblValue)

    or

    FormatNumber(dblValue, 2)

    The second parameter specifies the number of digits to the right of the
    decimal place that should be displayed.

    "Ron" <> wrote in message
    news:bdvfue$...
    > Can anyone tell me how I can remove a few zero's from the end of a double?
    >
    > For example, the number I have is 55.0000, the number I need is 55.00.
    >
    > How can I go about trimming the zeros?
    >
    > Thanks,
    >
    > Ron
    >
    >
     
    Scott Schluer, Jul 2, 2003
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Web learner

    from List <double> to double[]

    Web learner, Apr 25, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    752
  2. sb
    Replies:
    4
    Views:
    488
    Alberto Barbati
    Feb 19, 2004
  3. Jacek Dziedzic
    Replies:
    5
    Views:
    606
    Old Wolf
    Apr 8, 2004
  4. ferran
    Replies:
    9
    Views:
    3,370
    Kevin Goodsell
    Apr 12, 2004
  5. da Vinci
    Replies:
    5
    Views:
    8,977
    da Vinci
    Jul 31, 2004
  6. JKop
    Replies:
    4
    Views:
    16,792
  7. Sydex
    Replies:
    12
    Views:
    7,181
    Victor Bazarov
    Feb 17, 2005
  8. Ingo Nolden
    Replies:
    15
    Views:
    1,735
    Jerry Coffin
    Apr 30, 2005
Loading...