In VBA editor x = 1.1e-3 is reformated to x = 0.0011

  • Thread starter Thread starter elfnor
  • Start date Start date
E

elfnor

When I enter the line

x = 1.1e-3

in the visual basic editor and hit return, it is automatically
reformated to

x = 0.0011

Can I stop this? It makes it hard to check that constants such as
1.1e-11 are programed correctly.
 
You can declare Constants equal to the number and then use the
constants in your code...
Const OnePtOneE_3 As Double = 0.0011
Const OnePtOneE_11 As Double = 0.000000000011

x = OnePtOneE_11 * 2
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"elfnor"wrote in message
When I enter the line
x = 1.1e-3
in the visual basic editor and hit return, it is automatically
reformated to
x = 0.0011
Can I stop this? It makes it hard to check that constants such as
1.1e-11 are programed correctly.
 
Maybe something like:

X = 1.1 * 10 ^ -3

or

X = 1.1 * 10 ^(-3) to make sure the -3 is not read as a subtract
operation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top