omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Display a number in engineering notation

    Pythonista
    3
    3
    2193
    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.
    • donnieh
      donnieh last edited by

      Before I go wild and write an algorithm to convert a number to engineering notation, is anyone aware of a simple way to achieve this?

      How can I convert, for example, 1,234 into 1.234e+3
      or
      0.00123 into 1.23e-3?

      Phuket2 1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 @donnieh last edited by

        @donnieh , I am hopeless on this stuff, but I think

        f = 0.00123
        print '{0:e}'.format(f)
        
        1 Reply Last reply Reply Quote 2
        • ccc
          ccc last edited by

          http://stackoverflow.com/questions/12311148/print-number-in-engineering-format

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors