Field formula.
Page Tree | ||
---|---|---|
|
The calculated field. The value of this field is the result of the formula. The value can be further processed before display.
...
Field settings include three parts.
1 - The formula for calculating the value.
This value will fall into the search index and should correspond to the selected field type.
...
Code Block | ||
---|---|---|
| ||
function calc(){ return cfValues[10011] / cfValues[10010] } calc() |
2 - Formula for preparing data for display
Available Variables:
issue
cfValues
formulaValue - value of formula
...
Code Block | ||
---|---|---|
| ||
function timeFormat(sec_num) { var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours < 10) {hours = "0"+hours;} if (minutes < 10) {minutes = "0"+minutes;} if (seconds < 10) {seconds = "0"+seconds;} return hours+':'+minutes+':'+seconds; } timeFormat(formulaValue) |
3 - Html formatting the result
if specified, then this html will be displayed as the value of the field. In the indices, this will be the value of formula 1.