Velocity Reviews > Concatenating A Double

# 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

Steve C. Orr, MCSD
Guest
Posts: n/a

 07-02-2003
Try something like this:
MyDouble.ToString("C")

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
>
>

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
>
>