Developer Network
Developer Network
Developer Network
ProfileText
ProfileText
:CreateViewProfileText:
Sign in
Subscriber portal
Get tools
Downloads
Visual Studio
SDKs
Trial software
Free downloads
Office resources
Programs
Subscriptions
Overview
Administrators
Students
Microsoft Imagine
Microsoft Student Partners
ISV
Startups
Events
Community
Magazine
Forums
Blogs
Channel 9
Documentation
APIs and reference
Dev centers
Samples
Retired content
We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second.
This forum has migrated to
Microsoft Q&A
.
Visit
Microsoft Q&A
to post new questions.
Learn More
Ask a question
Quick access
Forums home
Browse forums users
FAQ
Search related threads
Remove From My Forums
Answered by:
Using Scientific Notation
Archived Forums 421-440
>
Visual Basic
Question
0
Sign in to vote
How do I make VB display a floating point double in scientific notation format
fjww
Monday, September 29, 2008 11:36 AM
Answers
1
Sign in to vote
Try this:
Dim d As
Double
=
2222
.0
TextBox1.Text
=
d
.ToString("0.000e0")
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Monday, September 29, 2008 12:20 PM
All replies
1
Sign in to vote
Try this:
Dim d As
Double
=
2222
.0
TextBox1.Text
=
d
.ToString("0.000e0")
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Marked as answer by
FJWW
Tuesday, September 30, 2008 3:32 PM
Monday, September 29, 2008 12:20 PM
0
Sign in to vote
Converting a Double to a string:
http://msdn.microsoft.com/en-us/library/shxtf045.aspx
Formatting numbers:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
You probably want to look at the exponent (e) format.
Stephen J Whiteley
Monday, September 29, 2008 1:14 PM
0
Sign in to vote
from the documentation
Dim
value
As
Double
= 12345.6789
Debug.WriteLine(value.ToString(
"E"
))
' Displays 1.234568E+004
Debug.WriteLine(value.ToString(
"E10"
))
' Displays 1.2345678900E+004
Debug.WriteLine(value.ToString(
"e4"
))
' Displays 1.2346e+004
Monday, September 29, 2008 2:04 PM