Visual Studio VB pretty listing settings

前端 未结 3 679
北荒
北荒 2020-12-21 06:33

Does anyone know how to stop Visual Studio VB.NET editor from changing my beautiful scientific notation numbers into hideous decimal notation?

It seems that this is

相关标签:
3条回答
  • 2020-12-21 06:47

    I don't think there's a way to do it. You could rely on the implicit CDbl() conversion in this situation:

    Dim myPrettyNumber As Double = "1E-16"
    

    Or if you just want to be able to read it more easily, add a comment:

    Dim myUglyNumber As Double = 0.0000000000000001 ' 1E-16
    
    0 讨论(0)
  • 2020-12-21 06:59

    There is an option in VB to turn off "pretty listing":

    http://msdn.microsoft.com/en-us/library/vstudio/y0y5th94.aspx

    0 讨论(0)
  • 2020-12-21 07:02

    You may turn pretty listing back on after defining your constants.

    Visual Basic won't obfuscate numbers that have already been defined so long as you don't modify the lines that they're on. If you accidentally do modify a line being forced to scientific notation Visual basic will only convert that line to use fixed notation.

    Obviously this works best for the declaration of constants or formula's that won't change very often. It is less viable otherwise.

    0 讨论(0)
提交回复
热议问题