Home All Groups Group Topic Archive Search About

needs double value in string format

Author
29 Mar 2010 8:16 AM
Valli
I have a double variable
Dim d as double. d gets values stored as 2010031266671939.0
I need this value in string.
If I use d.tostring(), it provides in E+ format. I need this double value in
string without E+ format.
If I use d.Tostring("#.0"), it rounds off the double value & provides as
2010031266671940.0.
I need the value as such.

Can anyone help me

--
Thanks & regards,

V.Vallikkannu
Project Leader
Chella Software Private Limited | Mobile : <9944254599.> | Off: +91 452
4262000 | www.chelsoft.com



This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

Any unauthorized review, use, disclosure, dissemination, forwarding,
printing or copying of this email is strictly prohibited and may be
unlawful.

Author
29 Mar 2010 8:28 AM
Cor Ligthert[MVP]
If you want it as a decimal format, then not first convert it to a decimal
format?

Show quoteHide quote
"Valli" <va***@chellsoft.com> wrote in message
news:#oFLigxzKHA.1236@TK2MSFTNGP06.phx.gbl...
> I have a double variable
> Dim d as double. d gets values stored as 2010031266671939.0
> I need this value in string.
> If I use d.tostring(), it provides in E+ format. I need this double value
> in string without E+ format.
> If I use d.Tostring("#.0"), it rounds off the double value & provides as
> 2010031266671940.0.
> I need the value as such.
>
> Can anyone help me
>
> --
> Thanks & regards,
>
> V.Vallikkannu
> Project Leader
> Chella Software Private Limited | Mobile : <9944254599.> | Off: +91 452
> 4262000 | www.chelsoft.com
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient, please contact the
> sender by reply e-mail and destroy all copies of the original message.
>
> Any unauthorized review, use, disclosure, dissemination, forwarding,
> printing or copying of this email is strictly prohibited and may be
> unlawful.
>
>
Author
29 Mar 2010 8:45 AM
Valli
I dont need in decimal. I need that double value as such in string to append
to a string variable.

--
Thanks & regards,

V.Vallikkannu
Project Leader
Chella Software Private Limited | Mobile : <9944254599.> | Off: +91 452
4262000 | www.chelsoft.com



This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

Any unauthorized review, use, disclosure, dissemination, forwarding,
printing or copying of this email is strictly prohibited and may be
unlawful.

Show quoteHide quote
"Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message
news:%23ZSahnxzKHA.4656@TK2MSFTNGP05.phx.gbl...
> If you want it as a decimal format, then not first convert it to a decimal
> format?
>
> "Valli" <va***@chellsoft.com> wrote in message
> news:#oFLigxzKHA.1236@TK2MSFTNGP06.phx.gbl...
>> I have a double variable
>> Dim d as double. d gets values stored as 2010031266671939.0
>> I need this value in string.
>> If I use d.tostring(), it provides in E+ format. I need this double value
>> in string without E+ format.
>> If I use d.Tostring("#.0"), it rounds off the double value & provides as
>> 2010031266671940.0.
>> I need the value as such.
>>
>> Can anyone help me
>>
>> --
>> Thanks & regards,
>>
>> V.Vallikkannu
>> Project Leader
>> Chella Software Private Limited | Mobile : <9944254599.> | Off: +91 452
>> 4262000 | www.chelsoft.com
>>
>>
>>
>> This e-mail and any files transmitted with it are for the sole use of the
>> intended recipient(s) and may contain confidential and privileged
>> information. If you are not the intended recipient, please contact the
>> sender by reply e-mail and destroy all copies of the original message.
>>
>> Any unauthorized review, use, disclosure, dissemination, forwarding,
>> printing or copying of this email is strictly prohibited and may be
>> unlawful.
>>
>>
Author
29 Mar 2010 9:39 AM
Andrew Morton
Valli wrote:
> I dont need in decimal. I need that double value as such in string to
> append to a string variable.

You should have played around with the various format options; I found:

Dim a As Double = 2010031266671939.0
Console.WriteLine(a.ToString("G20"))

outputs "2010031266671939".

Although the "R" format specifier may be more correct.

Andrew
Author
29 Mar 2010 9:53 AM
Valli
What this "G20" represents?
I am new to .net coding.

--
Thanks & regards,

V.Vallikkannu
Project Leader
Chella Software Private Limited | Mobile : <9944254599.> | Off: +91 452
4262000 | www.chelsoft.com



This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

Any unauthorized review, use, disclosure, dissemination, forwarding,
printing or copying of this email is strictly prohibited and may be
unlawful.

Show quoteHide quote
"Andrew Morton" <a**@in-press.co.uk.invalid> wrote in message
news:81bar7Fto6U1@mid.individual.net...
> Valli wrote:
>> I dont need in decimal. I need that double value as such in string to
>> append to a string variable.
>
> You should have played around with the various format options; I found:
>
> Dim a As Double = 2010031266671939.0
> Console.WriteLine(a.ToString("G20"))
>
> outputs "2010031266671939".
>
> Although the "R" format specifier may be more correct.
>
> Andrew
>
Author
29 Mar 2010 10:21 AM
Andrew Morton
Valli wrote:
> What this "G20" represents?
> I am new to .net coding.

Start up Visual Studio and open the solution/project you're working on.
Click the cursor onto an occurrence of .ToString and press F1. Hopefully
your VS help will be helpful and open a page about "Double.ToString". Find
the overload for ToString(String) and on the resulting page it will mention
"numeric format string". Click that link and head for the "Standard numeric
format strings".

Then you'll also be able to see why I think using "R" might be better.

HTH,

Andrew
Author
29 Mar 2010 11:19 AM
Armin Zingler
Am 29.03.2010 10:16, schrieb Valli:
> I have a double variable
> Dim d as double. d gets values stored as 2010031266671939.0
> I need this value in string.
> If I use d.tostring(), it provides in E+ format. I need this double value in
> string without E+ format.
> If I use d.Tostring("#.0"), it rounds off the double value & provides as
> 2010031266671940.0.
> I need the value as such.
>
> Can anyone help me

Andrew already described how to find it. Here's the link (just for later
if you want to know where to look for; (almost) everything is described
in the manual)

http://msdn.microsoft.com/en-us/library/fbxft59x.aspx



--
Armin