How can I make a long double in VBA

How can I double the time in VBA? I have googled here and there, and have seen some ugly things like

dim i as long i = 100 dim d as double d = i * 1.00000000001 

I have not tested this, I think it works, but my application is really sensitive to data, and I would like to actually have a listing that does not affect the data ... Does this not exist?

+4
source share
2 answers

You don’t need to throw anything, it will work fine

 dim i as long dim d as double i = 100 d = i 

(and it took me about 30 seconds to start Excel, press ALT-F11 and check it).

+6
source

VBA has a bunch of functions that start with 'C', which are used to explicitly throw between types. See CLng, CDbl, CDate to name a few.

+4
source

Source: https://habr.com/ru/post/1384321/


All Articles