MCPcopy Create free account
hub / github.com/SegataLab/lefse / funcIsValidPositiveNumberChar

Method funcIsValidPositiveNumberChar

lefsebiom/ValidateData.py:289–310  ·  view source on GitHub ↗

Validates a parameter as a valid character representing a number. :param parameterValue: Value to be evaluated. :type Unknown :return Boolean: True indicates the parameter is a valid value. :type Boolean

(parameterValue)

Source from the content-addressed store, hash-verified

287 #Tested 13
288 @staticmethod
289 def funcIsValidPositiveNumberChar(parameterValue):
290 """
291 Validates a parameter as a valid character representing a number.
292
293 :param parameterValue: Value to be evaluated.
294 :type Unknown
295 :return Boolean: True indicates the parameter is a valid value.
296 :type Boolean
297 """
298
299 #Check to make sure is a valid string
300 if not ValidateData.funcIsValidString(parameterValue):
301 return False
302
303 #Try to convert to decimal
304 try:
305 decimalConversion = decimal.Decimal(parameterValue)
306 if decimalConversion < 0:
307 return False
308 except:
309 return False
310 return True
311
312 #Tested 9
313 @staticmethod

Callers

nothing calls this directly

Calls 1

funcIsValidStringMethod · 0.80

Tested by

no test coverage detected