Python Forum
testing for Decimal w/o importing decimal every time
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
testing for Decimal w/o importing decimal every time
#3
Wouldn't
if type(value) == "<class 'decimal.Decimal'>":
    print('is decimal')
be better?
Reply


Messages In This Thread
RE: testing for Decimal w/o importing decimal every time - by Yoriz - May-06-2019, 12:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Precision with Decimal Type charlesrkiss 9 855 Jan-18-2024, 06:30 PM
Last Post: charlesrkiss
  Python Struct Question, decimal 10, \n and \x0a. 3python 2 702 Aug-11-2023, 09:29 AM
Last Post: 3python
  Issue in writing sql data into csv for decimal value to scientific notation mg24 8 3,194 Dec-06-2022, 11:09 AM
Last Post: mg24
  method to remove zero digits from fraction in decimal Skaperen 17 2,916 Oct-23-2022, 04:02 AM
Last Post: Skaperen
  Decimal context stevendaprano 1 1,085 Apr-11-2022, 09:44 PM
Last Post: deanhystad
  decimal comma DPaul 9 2,394 Feb-22-2022, 12:25 PM
Last Post: DeaD_EyE
  Conversion from hexa to decimal in loop bugging Personne 1 1,317 Feb-22-2022, 04:32 AM
Last Post: deanhystad
  Calculate the Euler Number with more decimal places Pedroski55 10 4,661 Oct-31-2021, 04:45 AM
Last Post: Pedroski55
  idle and characters with decimal value>127 hakelm 14 4,611 Jun-19-2021, 07:32 AM
Last Post: hakelm
  How to use a variable in Python (2.x) to define decimal part? MDRI 4 2,391 May-07-2021, 12:39 AM
Last Post: MDRI

Forum Jump:

User Panel Messages

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