Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Number Format
#1
I'm strictly a hardware type and am caught in a conundrum trying to capture data from my oscilloscope.
I know nothing about Python, but found a workable solution on EEVblog.
Sample code which samples Channel 1 and writes to a CSV file :
   # Read DS1054Z Channel 1
    telnetToInstrument.write(":MEAS:ITEM? VAVG, CHAN1\n")
    buff = telnetToInstrument.read_until("\n", maxWaitForAnswer)
    csvLine += "," + buff[:-1]
Now this works just fine but has one problem :
It writes in scientific notation (nnnEXPmmm)
Which is really hard to read (logging the output of a photovoltaic panel)
How can I make it write in standard decimal ie NN.NN (13.65 volts for instance)
Any help appreciated.
Thanks, Mike
Reply


Messages In This Thread
Changing Number Format - by moby - May-24-2019, 08:52 PM
RE: Changing Number Format - by ichabod801 - May-24-2019, 09:04 PM
RE: Changing Number Format - by moby - May-24-2019, 09:16 PM
RE: Changing Number Format - by ichabod801 - May-24-2019, 09:45 PM
RE: Changing Number Format - by snippsat - May-24-2019, 11:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue in changing data format (2 bytes) into a 16 bit data. GiggsB 11 2,950 Jul-25-2022, 03:19 PM
Last Post: deanhystad
Photo How can I use 2 digits format for all the number? plumberpy 6 2,564 Aug-09-2021, 02:16 PM
Last Post: plumberpy
  multiple number format conversion oli_action 4 2,728 Aug-11-2020, 05:10 AM
Last Post: perfringo
  Number format william888 3 2,963 Aug-23-2019, 05:33 AM
Last Post: ThomasL
  changing format to Int Scott 3 2,599 Jun-19-2019, 06:33 AM
Last Post: ODIS
  changing { and } in str.format() Skaperen 10 5,291 May-16-2019, 05:07 AM
Last Post: Skaperen
  Counting the number of files related to particular format ambush 3 3,048 Nov-05-2018, 08:58 AM
Last Post: buran
  Date Format Changing Program Not Working pyth0nus3r 2 4,973 Jan-28-2017, 10:34 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020