473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

conversion in c#.net

38
Hi everyone!!!!!

How to convert a decimal number into exponent form. For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

Thanks in advance
siri
Jan 4 '08 #1
6 1045
kenobewan
4,871 Expert 4TB
Have you tried using convert()?
Jan 4 '08 #2
siri11
38
Hi everyone!!!!!

How to convert a decimal number into exponent form. For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

Thanks in advance
siri
Jan 7 '08 #3
r035198x
13,262 8TB
Hi everyone!!!!!

How to convert a decimal number into exponent form. For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

Thanks in advance
siri
Try

Expand|Select|Wrap|Line Numbers
  1. Console.WriteLine("{0:E}", 0.0000033968882807858478);
Jan 7 '08 #4
siri11
38
Hi Everyone!!!!!

How to convert a number.For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

I got the below code from ur replies

Console.WriteLine("{0:E}", 0.0000033968882807858478);----->I tried using this but,this doesn't help.

Plzzzzzzzzz help

Thanks in advance
siri
Jan 10 '08 #5
r035198x
13,262 8TB
Hi Everyone!!!!!

How to convert a number.For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

I got the below code from ur replies

Console.WriteLine("{0:E}", 0.0000033968882807858478);----->I tried using this but,this doesn't help.

Plzzzzzzzzz help

Thanks in advance
siri
You can also use the ToString method to for formatting

Expand|Select|Wrap|Line Numbers
  1. double v = 0.0000033968882807858478; 
  2. string str = v.ToString("e"); 
  3. Console.WriteLine(str); 
Jan 10 '08 #6
Plater
7,872 Expert 4TB
Hi everyone!!!!!

How to convert a decimal number into exponent form. For example convert this number--> 0.0000033968882807858478 to 3.39688828078581E-06 in c#.net.Is there a function or any other way.Plzzz provide the code.

Thanks in advance
siri
I have merged all THREE of your threads. Please do not continue to double (or triple) post your questions. That is against the rules of the site. (See Posting Guidelines and Flooding)

The answer has been provided to you, just in a manor that would have you do a little bit of leg work.
Take a look at the .ToString() overloads in the msdn and you will find your answer
Jan 10 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
31
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
3
by: Steve Richter | last post by:
here is a warning I am getting in a C++ .NET compile: c:\SrNet\jury\JuryTest.cpp(55) : warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied while...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
21
by: REH | last post by:
It it permissible to use the constructor style cast with primitives such as "unsigned long"? One of my compilers accepts this syntax, the other does not. The failing one chokes on the fact that the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.