Python Forum
Convert SQLite Fetchone() Result to float for Math
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert SQLite Fetchone() Result to float for Math
#3
One way, would be to unpack the tuple...

fpn = tuple[0]
... where fpn is a variable to hold the floating point number and tuple is the tuple to be unpacked.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
RE: Convert SQLite Fetchone() Result to float for Math - by rob101 - Aug-01-2022, 08:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python calculate float plus float is incorrect? sirocawa 6 2,344 Apr-16-2024, 01:45 PM
Last Post: DeaD_EyE
  convert result to hex ascii Jusufs 6 3,913 May-19-2023, 03:21 PM
Last Post: deanhystad
  math formula does not give the same result as bash script [SOLVED] AlphaInc 3 1,879 Apr-02-2023, 07:21 PM
Last Post: AlphaInc
  convert string to float in list jacklee26 6 3,709 Feb-13-2023, 01:14 AM
Last Post: jacklee26
  openpyxl convert data to float jacklee26 13 12,814 Nov-19-2022, 11:59 AM
Last Post: deanhystad
  Convert string to float problem vasik006 8 5,678 Jun-03-2022, 06:41 PM
Last Post: deanhystad
  math.log versus math.log10 stevendaprano 10 4,747 May-23-2022, 08:59 PM
Last Post: jefsummers
  Why getting ValueError : Math domain error in trig. function, math.asin() ? jahuja73 3 5,396 Feb-24-2021, 05:09 PM
Last Post: bowlofred
  SQL and fetchone Scorpio 6 9,123 Oct-14-2020, 02:24 PM
Last Post: beebert69
  ValueError: could not convert string to float: RandomCoder 3 7,942 Jul-27-2020, 07:38 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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