I tried all different combos and can get the desired result when converting 1cm to km 0.00001.
I used
Code:
tbxLenKm.Text = km.ToString("F5");
The calculator shows the answer correctly. However, when i convert 1000cm for instance, the answer is 0.01000 or converting 1,000,000cm, the answer is 10.00000.
I dont really want the extra zeros after, i just want to be able to show preceeding zeros for very small answers (like in 0.00001 not 1.00000)
-----Edit-----
I have done further testing not using a format and had some strange results.
converting inches to kilometres. Using the code below: i get the answer 2.54E-05 when i run the program and convert the number 1.
Code:
double km = length * 0.0000254;
tbxLenKm.Text = km.ToString();
converting inches to feet. Using the code below: i get the answer 0.083333333333 when i run the program and convert the number 1.
Code:
double feet = length * 0.083333333333;
tbxLenFt.Text = feet.ToString();
Why is one giving an exponent and the other doesnt? I also changed the km conversion rate to have the same length number (0.000025400000) and it still gave an exponent.
Weird.