Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to convert scientific notation to standard?

    Help wanted · · · – – – · · ·
    2
    3
    400
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sweezy92
      sweezy92 last edited by

      Hello,

      I have a text file with data like this:

      *Name: 1
      55.0021 1.1E1
      103.9542 4.0E-1
      …

      Name: 1
      …*

      I want to convert the numbers in scientific notation into standard decimals. There is no other way for me to export the data. So I need to do it here. Could you help me?

      Thanks!

      Ekopalypse 1 Reply Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse @sweezy92 last edited by

        @sweezy92

        depending on your real data and that you have python script plugin installed
        this might do what you want

        editor.rereplace('\d+?\.\d+?E\-*\d', lambda m: float(m.group()))
        
        1 Reply Last reply Reply Quote 2
        • sweezy92
          sweezy92 last edited by

          @Ekopalypse said in How to convert scientific notation to standard?:

          editor.rereplace(‘\d+?.\d+?E-*\d’, lambda m: float(m.group()))

          I just installed the plugin and tried the code. It works perectly. Thanks a lot!

          1 Reply Last reply Reply Quote 3
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors