summaryrefslogtreecommitdiff
path: root/Param/Float/__init__.py
blob: eada7ac42ee21923343dc29d640fbbbd54f91f49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from Param import Param

def ParamFloat(Param):
  def __init__(self, value, classname=""):
    self._classname = classname
    super(ParamFloat).__init__()
    try: 
      self.value = float(value)
    except Exception as e:
      self.err_warn("Not a float: %s" % str(value))
      self.err_warn(str(e))
  def __int__(self):
    return int(self.value)
  
  def __float__(self):
    return float(self.value)