473,412 Members | 2,239 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,412 software developers and data experts.

0.00007m -> 7E-5 ?

Hello.
I'd want to see the right value that inserted, but very small value like
0.00007m doesn't displayed exactly(displayed 7E-5).

ex)
decimal b = 0.00007m;

TextBox.Text = b.ToString(); => 7E-5
TextBox.Text = b.ToString("F"); => 0.00
TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
supported)
TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000

so, I want to know the string format type that all decimal values show the
values as it is.

decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
0.0000000000007m )
TextBox.Text = b.ToString(????); => 0.00007

Please, help me~ ^^

ps. maybe understanding this question is harder than solving..^^ sorry and
thanks..
Nov 16 '05 #1
4 1762
Where are you putting the data to be shown at ? I compiled this code and
it showed up exactly perfect, the way it should:

decimal d = 0.00007m;
string test = d.ToString();
MessageBox.Show(test);

I got a response of a messagebox showing 0.00007

The problem could be perhaps that whatever you are showing the data in
cannot support a number that big(or small)?

Lowell

antonio. kim wrote:
Hello.
I'd want to see the right value that inserted, but very small value like
0.00007m doesn't displayed exactly(displayed 7E-5).

ex)
decimal b = 0.00007m;

TextBox.Text = b.ToString(); => 7E-5
TextBox.Text = b.ToString("F"); => 0.00
TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
supported)
TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000

so, I want to know the string format type that all decimal values show the
values as it is.

decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
0.0000000000007m )
TextBox.Text = b.ToString(????); => 0.00007

Please, help me~ ^^

ps. maybe understanding this question is harder than solving..^^ sorry and
thanks..

Nov 16 '05 #2
Thank you for answering..
but I use the same code that you suggest, I got 7E-5...
maybe other configulation is different between our machines..
is there anybody knows this?

"Lowell Heddings" wrote:
Where are you putting the data to be shown at ? I compiled this code and
it showed up exactly perfect, the way it should:

decimal d = 0.00007m;
string test = d.ToString();
MessageBox.Show(test);

I got a response of a messagebox showing 0.00007

The problem could be perhaps that whatever you are showing the data in
cannot support a number that big(or small)?

Lowell

antonio. kim wrote:
Hello.
I'd want to see the right value that inserted, but very small value like
0.00007m doesn't displayed exactly(displayed 7E-5).

ex)
decimal b = 0.00007m;

TextBox.Text = b.ToString(); => 7E-5
TextBox.Text = b.ToString("F"); => 0.00
TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
supported)
TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000

so, I want to know the string format type that all decimal values show the
values as it is.

decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
0.0000000000007m )
TextBox.Text = b.ToString(????); => 0.00007

Please, help me~ ^^

ps. maybe understanding this question is harder than solving..^^ sorry and
thanks..

Nov 16 '05 #3
Odd,

As far as I know the only configuration differences are in currency
formats and the use of , or . as decimal point.

Regular output for me is always 0,00007 (, is the decimal point) and
scientific format ("E") is output as 7,000000E-005 not 7E-5.

You might try the General specifier ("G") which outputs the number in the
shortest of fixed or scientific. This always gave me 0,00007.

Btw, "0.0000" == "F5", easier to write :)

On Tue, 14 Dec 2004 00:27:02 -0800, Antonio. kim
<An********@discussions.microsoft.com> wrote:
Thank you for answering..
but I use the same code that you suggest, I got 7E-5...
maybe other configulation is different between our machines..
is there anybody knows this?

"Lowell Heddings" wrote:
Where are you putting the data to be shown at ? I compiled this code and
it showed up exactly perfect, the way it should:

decimal d = 0.00007m;
string test = d.ToString();
MessageBox.Show(test);

I got a response of a messagebox showing 0.00007

The problem could be perhaps that whatever you are showing the data in
cannot support a number that big(or small)?

Lowell

antonio. kim wrote:
> Hello.
> I'd want to see the right value that inserted, but very small value

like
> 0.00007m doesn't displayed exactly(displayed 7E-5).
>
> ex)
> decimal b = 0.00007m;
>
> TextBox.Text = b.ToString(); => 7E-5
> TextBox.Text = b.ToString("F"); => 0.00
> TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
> supported)
> TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
>
> so, I want to know the string format type that all decimal values

show the
> values as it is.
>
> decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
> 0.0000000000007m )
> TextBox.Text = b.ToString(????); => 0.00007
>
> Please, help me~ ^^
>
> ps. maybe understanding this question is harder than solving..^^

sorry and
> thanks..


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #4
Doubles seem to use the scientific format you mentioned. Are you sure you're
using decimal?

For me, it's:

0.00007.ToString() => 7E-5
0.00007m.ToString() => 0,00007

even

0.0000000000000000000000000007m.ToString()
yields
0,0000000000000000000000000007

HTH,
Stefan

"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opsizswjb8klbvpo@pbn_computer...
Odd,

As far as I know the only configuration differences are in currency
formats and the use of , or . as decimal point.

Regular output for me is always 0,00007 (, is the decimal point) and
scientific format ("E") is output as 7,000000E-005 not 7E-5.

You might try the General specifier ("G") which outputs the number in the
shortest of fixed or scientific. This always gave me 0,00007.

Btw, "0.0000" == "F5", easier to write :)

On Tue, 14 Dec 2004 00:27:02 -0800, Antonio. kim
<An********@discussions.microsoft.com> wrote:
Thank you for answering..
but I use the same code that you suggest, I got 7E-5...
maybe other configulation is different between our machines..
is there anybody knows this?

"Lowell Heddings" wrote:
Where are you putting the data to be shown at ? I compiled this code and
it showed up exactly perfect, the way it should:

decimal d = 0.00007m;
string test = d.ToString();
MessageBox.Show(test);

I got a response of a messagebox showing 0.00007

The problem could be perhaps that whatever you are showing the data in
cannot support a number that big(or small)?

Lowell

antonio. kim wrote:
> Hello.
> I'd want to see the right value that inserted, but very small value
like
> 0.00007m doesn't displayed exactly(displayed 7E-5).
>
> ex)
> decimal b = 0.00007m;
> TextBox.Text = b.ToString(); => 7E-5
> TextBox.Text = b.ToString("F"); => 0.00
> TextBox.Text = b.ToString("0.00000"); => 0.00007 (but 0.00000007 not
> supported)
> TextBox.Text = b.ToString("0.0000000000"); => 0.0000700000
>
> so, I want to know the string format type that all decimal values
show the
> values as it is.
>
> decimal b = 0.00007m; ( for all decimal cases like 0.0000007m,
> 0.0000000000007m )
> TextBox.Text = b.ToString(????); => 0.00007
>
> Please, help me~ ^^
>
> ps. maybe understanding this question is harder than solving..^^
sorry and
> thanks..


--
Happy Coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #5

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

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
2
by: bissatch | last post by:
Hi, I am currently writing a simple PHP program that uses an XML file to output rows for a 'Whats New' page. Once written, I will only require updating the XML file and any pages that use the...
0
by: antonio. kim | last post by:
Hello. I'd want to see the right value that inserted, but very small value like 0.00007m doesn't displayed exactly(displayed 7E-5). ex) decimal b = 0.00007m; TextBox.Text = b.ToString(); =>...
2
by: santaji | last post by:
I am getting xml string in request attribute in following format &lt;files&gt; &lt;file&gt; &lt;filename&gt;somefile.ext&lt;/filename&gt; &lt;/file&gt; &lt;files&gt; the above string I want to convert to tags. expected...
1
by: VaidehiPawar | last post by:
I am a beginner level in xml..my output page does not convert &gt &lt it shows something like this " &lt;b&gt;Location.&lt;/b&gt;&lt;br /&gt; &lt;UL&gt;&lt;LI&gt;Park Central New York " can anyone help? here is my code ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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
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...

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.