473,467 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Concatenating A Double

Ron
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
Nov 17 '05 #1
2 1257
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" <ro*@razorvision.net> wrote in message
news:bd********@library2.airnews.net...
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

Nov 17 '05 #2
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" <ro*@razorvision.net> wrote in message
news:bd********@library2.airnews.net...
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: foodic | last post by:
i am fresher to C++ programming, and I just want to learn Concatenating Calls, I have written a program, class SetMe { public: void setX(int x) {_x = x;} void setY(int y) {_y = y;} void...
16
by: Dixie | last post by:
I have a problem using Dev Ashish's excellent module to concatenate the results of a field from several records into one record. I am using the code to concatenate certain awards onto a...
3
by: Peng Yu | last post by:
I'm going to do something like this #define INSPECT( FILENAME,) \ ofstream FILENAME("FILENAME.out");\ For example, I want "INSPECT(abc)" open a file with name "abc.out", the file object's...
5
by: Richard Chen | last post by:
Hi I want to construct a long string in C# in multiple lines therefore I need a symbol to concatenate each line to the next line till the end of the string. In VB, there's a symbol "_" can be...
4
by: Juan | last post by:
Does any one know if there are reported bugs when concatenating strings? When debugging each variable has the correct value but when I try to concatenate them some values are missing (I can´t see...
4
by: FB's .NET Dev PC | last post by:
Interesting note, the code below as is will attempt to cast what is clearly indicated as a string into a double. This is becuase the use of + as a concatenation operator. The error message...
5
by: john | last post by:
In a query I have the fields Letter, Prefix, and Surname. I need to make a report in which there is one field called Name which is a concatenation of the three fields. When I do this: Expr2: +"...
7
by: Mary | last post by:
I have a student who has a hyphenated first name. If I concatenate the name like this: StudentName:( & ", " & ), it works as expected. If, however, I try to get the first name first by...
2
by: Oki | last post by:
I appreciate any help; I'm currently getting a problem with trying to concatenate a single char from a structure to an existing string. Basically, the problem is here: strcat( res, morse_c.letter...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.