Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Concatenating A Double

Reply
Thread Tools

Concatenating A Double

 
 
Ron
Guest
Posts: n/a
 
      07-02-2003
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


 
Reply With Quote
 
 
 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      07-02-2003
Try something like this:
MyDouble.ToString("C")

Here's more info:
http://msdn.microsoft.com/library/de...matstrings.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


"Ron" <(E-Mail Removed)> wrote in message
news:bdvfue$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Scott Schluer
Guest
Posts: n/a
 
      07-02-2003
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" <(E-Mail Removed)> wrote in message
news:bdvfue$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenating Audio Files in with Perl on a Mac Gary Morrison Perl 5 03-28-2006 12:45 AM
adding strings, not concatenating them Stan Horwitz Perl 2 02-15-2006 08:38 PM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Concatenating fields that may contain NULL Craig ASP .Net 2 10-22-2004 07:59 PM
Concatenating asp server controls Ani ASP .Net 1 10-27-2003 04:38 PM



Advertisments