public function getValue( $field, $default = null ) {
        if ( array_key_exists($field, $this->defaults) ){
            switch ($this->defaults[$field]['type']) {
                case self::TYPE_INT:
                    return (int) $this->values[$field];
                case self::TYPE_FLOAT:
                    // Round float values to three decimal places and trim trailing zeros.
                    // Add a leading zero to values less than 1.
                    $f = sprintf('%05.3f', $this->values[$field]);
                    $f = rtrim($f, '0');
                    $f = rtrim($f, '.');
                    return (float) (empty($f) ? '0' : $f);
            }
            return $this->values[$field];
        }

        return $default;
    }