TinyButStrong - the PHP Template Engine
Categories > OpenTBS general >

Feature request: operations on fields

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Walter
Date: 2014-09-08
Time: 16:17

Feature request: operations on fields


I know it is not possible with normal tags, and sometimes it is possible with onData, but what I want to achieve is mathematical operations with both operands variables


value=[block1:num] equal to [block1:num;ope=div:[value2]]


As you can see.. [block1:num;ope=div:[value2]]

By: Skrol29
Date: 2014-09-08
Time: 18:10

Re: Feature request: operations on fields

Hello Walter,

It seems to can easily achieve this using the parameter "onformat".

Simple example:

function f_format_div($FieldName,&$CurrVal,&$CurrPrm) {
   $CurrVal = $CurrVal / $CurrPrm['value2'];


value=[block1.num] equal to [block1.num;onformat=f_format_div;value2=29]