# 4.5. Average, variable 'pt'.

We know, therefore, how the program forward formula browsing information by which time he was talking about. We lack even one piece of information to set - the variable pt. The variable pt is a variable in which draw3 before the formula is placed about what kind of average formula is calculated. If the program display is set to 'age', it will be interested in the monthly average, the screen will be a monthly average Daily, etc. In contrast to the variable t, the variable entitled not accept the numerical but only one of the values from the specified file.

The best example would be here. Let's take a parameter that will accept different value depending on which time interval is selected in the program viewers, this is the formula:

```if pt == PT_YEAR then
v = 5
elseif pt == PT_MONTH then
v = 4
elseif pt == PT_DAY then
v = 3
elseif pt == PT_HOUR8 then
v = 2
elseif pt == PT_MIN10 then
v = 1
else
v = 0
end```

Notatka: Please note that in the peer-reviewed this parameter was set attribute 'Average counted as' on 'the result of applying the formula for the average'.

Now what do we see? We get a parameter that, if we choose the screen a decade will return a value of 5, the year the value of 4, the monthly value of 2 when the day value of one and zero otherwise.

PT_YEAR, PT_MONTH, PT_DAY, PT_HOUR8, PT_MIN10, PT_WEEK i PT_SEC10 then all permissible value of the variable pt.