473,320 Members | 1,982 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,320 software developers and data experts.

What Numeric Notation is This and How To Convert?

I am converting old code to .NET (C#).

I have step trace through the old code, it creates a string like ".2000000000D-1" which later converts to 0.02 via CCur(Val()) in VB6.

What is this form of numeric notation? The old code's variable names suggests that it's some form of Scientific Notation. However, all that I have read about it Scientific Notation an "E" used, not a "D". What is this form of numeric notation?


What do you recommend as the best conversion function to convert this string ".2000000000D-1" to 0.02?

Thanks in advance.

UDT

Update:

I ran some tests with large and small numbers. I changed C# code to use an "E" instead of a "D". Then I converted string via Convert.ToDouble(). This seems to work so far. Couple of test results:

".8990500000E5" does convert to 89905.0
".1000000000E-1" does convert to 0.01

But still, what is that "D" numeric notation?
Jun 20 '10 #1
4 2431
ThatThatGuy
449 Expert 256MB
@UpsideDownTire
D stands for Double Value...
E stands for exponent value
Jun 21 '10 #2
Plater
7,872 Expert 4TB
I would say it was just sloppy old VB code. I've never heard of a D being used in a standard notation of any form, just the E
Jun 21 '10 #3
@ThatThatGuy: Can you tell me more about your reply? Is "D" another form of numeric notation? Or, is it antiquated VB6 specific?

@Plater: Au contraire, that old VB code works great. In VB6 ".2000000000D-1" returns a value of 0.02 just like my newer C# from yesterday where ".2000000000E-1" also returns 0.02. So I doubt the VB6 code is sloppy.

Am I using "E" for now and my app is working great, a lot like the original VB6. However, I'm looking to be thorough with this type of notation and to learn more about it.
Jun 21 '10 #4
Plater
7,872 Expert 4TB
I didn't say it didn't work, just that it was sloppy. VB was a very sloppy language, it let you get away with all kinds of things. It probably would have worked if you had used a Q instead too.
Jun 22 '10 #5

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

Similar topics

20
by: Market Mutant | last post by:
www.51.ca is a nice site, and I want to build something similar and wonder if anyone knows if they are using PHPNuke or other nukes or they wrote everything themselves. What is the signature thing...
1
by: huzhenghui37 | last post by:
what relationship between this mail list and the python group on Google? i saw the same info on both
2
by: Supra | last post by:
in IE explorer......what control is this...it is toolbar? that had round button...similar to netscape and firefox.. does ne 1 knows? regards, supra
5
by: John Smith | last post by:
I am writing a program which should keep running if not interrupted. While testing the program, I noticed that when the program was first run, the cpu usage (on WinXP) was between 0 to 2 %. In the...
2
by: active | last post by:
Set(ByVal NewSize As Drawing.Size) Me.AutoScrollMinSize = NewSize picDisplay.Size = NewSize picMarquee.Size = NewSize AdjustBitmap()
12
by: JC | last post by:
Hi... Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error...
1
by: sathyan8294 | last post by:
what is websites for convert javascript to vbscript?
0
by: DR | last post by:
PerformanceCounterCategory.Create() takes 3 minutes to add a new category!! How come? What can cause this?
7
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I'm a VB.NET guy trying my best to learn C#.NET. I have an existing C# application I'm trying to understand, and there is one piece of syntax I can't wrap my head around. It is: (byte)0 ...
2
by: prw8864 | last post by:
I can not see what is causing this error.... iterator has been defined properly, but the error seems to point to the interator type. Errors I get with g++ svector.c++ -o svector 2> ./err_txt...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: 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...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.