Scientific Notation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Ferrao

    Scientific Notation

    Hi,

    I would like to prevent Visual Studio .Net from automatically converting
    1e3 to 1000 in my source code.

    Is there a way to do this without turning off any other automatic
    formating features?

    Thanks in advance,

    Luis

    *** Sent via Developersdex http://www.developersdex.com ***
  • Herfried K. Wagner [MVP]

    #2
    Re: Scientific Notation

    "Luis Ferrao" <lfr@undisclose d.com> schrieb:[color=blue]
    > I would like to prevent Visual Studio .Net from automatically converting
    > 1e3 to 1000 in my source code.
    >
    > Is there a way to do this without turning off any other automatic
    > formating features?[/color]

    AFAIK there is no way to turn off this particular feature without turning
    off other valuable features of the IDE too.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Daniel

      #3
      Re: Scientific Notation

      Luis Ferrao wrote:[color=blue]
      > Hi,
      >
      > I would like to prevent Visual Studio .Net from automatically converting
      > 1e3 to 1000 in my source code.
      >
      > Is there a way to do this without turning off any other automatic
      > formating features?
      >
      > Thanks in advance,
      >
      > Luis
      >
      > *** Sent via Developersdex http://www.developersdex.com ***[/color]
      Could you not use the format command to specify the number of trailing
      digits?

      --

      Daniel
      MCSE, MCP+I, MCP in Windows 2000/NT

      --------------------------------------
      remove the 2nd madrid from my mail address to contact me.

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Scientific Notation

        "Daniel" <daniel@madridm adridsoleado.co m> schrieb:[color=blue][color=green]
        >> I would like to prevent Visual Studio .Net from automatically converting
        >> 1e3 to 1000 in my source code.
        >>
        >> Is there a way to do this without turning off any other automatic
        >> formating features?
        >>[...][/color]
        > Could you not use the format command to specify the number of trailing
        > digits?[/color]

        I assume that the OP is referring to numeric literals placed directly in the
        source code.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        • Luis Ferrao

          #5
          Re: Scientific Notation

          Yes i'm talking about the numbers as i type them in visual studio's text
          editor.

          In C# if i type 1e3 it stays that way but in VB 1e3 turns into 1000.0

          Isn't there a way to configure the formating rules?

          *** Sent via Developersdex http://www.developersdex.com ***

          Comment

          • Ross Presser

            #6
            Re: Scientific Notation

            On Thu, 07 Jul 2005 03:26:50 -0700, Luis Ferrao wrote:
            [color=blue]
            > Yes i'm talking about the numbers as i type them in visual studio's text
            > editor.
            >
            > In C# if i type 1e3 it stays that way but in VB 1e3 turns into 1000.0
            >
            > Isn't there a way to configure the formating rules?
            >[/color]
            Tools / Options / Text Editor / Basic / VB Specific
            Unselect "Pretty listing (reformatting) of code"

            You will lose the other functions of pretty listing:
            * Align your code to the correct tab position
            * Recase keywords, variables, and objects to the correct case
            * Add a missing Then to an If...Then statement
            * Add parenthesis to function calls
            * Add missing end quotes to strings
            * Reformat exponential notation
            * Reformat dates

            And if you ever type control-K control-D to force it to reformat, it will
            change 1e3 to 1000.0 at that time too.

            You could always do something like this:

            Dim N as Single = "1e3"

            and let the implicit CSng() happen. I believe when compiled it would
            optimize the same. Even if not, it's a pretty small penalty.

            Comment

            Working...