Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2004

Tip: Looking for answers? Try searching our database.

converting double to string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
masoud bayan - 14 Oct 2004 19:44 GMT
I have some values in type of double such 0.00009 , 0.0000007, when I want
to show them in a text box and convert them to string they are changed to
scientific notation while I want to show them as they are.
I tried to use  tostring("f")  but it needs to have a precision number after
*f* which will cause always have fix number of characters (for example if
use f10 then 0.09 is converted to 0.09000000 while I need to show it as
0.09).
do you any suggestion of how I can convert such a numbers to string and show
them as they are not as scientific notation?

Thanks for any feedback
Mary Chipman - 14 Oct 2004 20:06 GMT
See the Help topic "Standard Numeric Format Strings", which lists all
of the format specifiers you can use to get your numbers to display
the way you want them to.

--Mary

>I have some values in type of double such 0.00009 , 0.0000007, when I want
>to show them in a text box and convert them to string they are changed to
[quoted text clipped - 7 lines]
>
>Thanks for any feedback
masoud bayan - 14 Oct 2004 20:15 GMT
Thanks for your reply.
I have seen that before but could not find any answer for this question.

Masoud

> See the Help topic "Standard Numeric Format Strings", which lists all
> of the format specifiers you can use to get your numbers to display
[quoted text clipped - 13 lines]
> >
> >Thanks for any feedback
Josip Medved - 14 Oct 2004 21:33 GMT
> I have some values in type of double such 0.00009 , 0.0000007, when I want
> to show them in a text box and convert them to string they are changed to
[quoted text clipped - 7 lines]
> show
> them as they are not as scientific notation?

ToString("0.########")

Signature

Pozdrav,
 Josip Medved, MCSD
 http://www.jmedved.com

masoud bayan - 15 Oct 2004 14:03 GMT
Thanks Josip,
Your reply is exactly what I need!
It is much more helpful than the suggestion >> *See the Help topic "Standard
Numeric Format Strings", *

Masoud

> > I have some values in type of double such 0.00009 , 0.0000007, when I want
> > to show them in a text box and convert them to string they are changed to
[quoted text clipped - 9 lines]
>
> ToString("0.########")

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.