在下面的代码中,我在确保文件编写器不会将我的数字四舍五入到一定的小数位时遇到问题。我需要使用变体,因为有时值是字符串,有时是数字。
我怎样才能强制它准确地写出变量是什么?例如,下面的代码可能显示 0.00038,我想显示确切的值。
Dim MyFile1 As Variant
Dim MyNumber as Variant
MyFile0 = "C:/myfile.csv"
fnum0 = FreeFile()
Open MyFile0 For Output As fnum0
MyNumber = 0.0003759656
Print #fnum0, MyNumber