Example #1
0
 def picometers(self, value):
     self._value = multiplyIfNotNone(value, MetricPrefix.Pico)
     return
Example #2
0
 def kilometers(self, value):
     self._value = multiplyIfNotNone(value, MetricPrefix.Kilo)
     return
Example #3
0
 def nanometers(self, value):
     self._value = multiplyIfNotNone(value, MetricPrefix.Nano)
     return
Example #4
0
 def micrometers(self, value):
     self._value = multiplyIfNotNone(value, MetricPrefix.Micro)
     return
Example #5
0
 def centimeters(self, value):
     self._value = multiplyIfNotNone(value, MetricPrefix.Centi)
     return
Example #6
0
 def __mul__(self, other):
     self.checkType(
         expectedType=NumberTypes,
         value=other,
         exceptionMessage='Lengths can only be multiplied by numbers.')
     return Length(meters=multiplyIfNotNone(self.meters, other))
Example #7
0
 def __neg__(self):
     return Length(meters=multiplyIfNotNone(self.meters, -1))