Module cNumber
Extend standard number with min/max and polarity.
## A good base class for e.g. device parameters, which it is modelled over
Functions
__add (val) | Meta-methods |
Fields
self.polarity | cNumber.POLARITY |
self.value_min | number |
self.value_max | number |
self.value_quantum | number, value of 1 means integer |
self.value_enums | table, strings representing enum states (only relevant when integer) |
self.value_factor | number, how to scale value - '1' with factor of 100 becomes '100' this is relevant for some values that are represented differently than their actual value (e.g. |
self.value_tostring | function, when defined also define value_tonumber |
self.value_tonumber | function, when defined also define value_tostring |
self.zero_based | bool, when value starts from zero (it should be used for display purposes only) |
Functions
Fields
- self.polarity
- cNumber.POLARITY
- self.value_min
- number
- self.value_max
- number
- self.value_quantum
- number, value of 1 means integer
- self.value_enums
- table, strings representing enum states (only relevant when integer)
- self.value_factor
- number, how to scale value - '1' with factor of 100 becomes '100' this is relevant for some values that are represented differently than their actual value (e.g. 'phrase.shuffle')
- self.value_tostring
- function, when defined also define value_tonumber
- self.value_tonumber
- function, when defined also define value_tostring
- self.zero_based
- bool, when value starts from zero (it should be used for display purposes only)