how to make an accumulator in apache velocity

0

I am trying to make a simple accumulator within a foreach in apache velocity and I would not be accumulating the values .. I did not find any documentation about the scopes that manages velocity .. some example of how to do this in velocity ?

#set( $descuento = 0 ) 

#foreach($item in $items)

$descuento = $descuento+$item.cantidad 

#end
    
asked by ObjectManager 29.11.2018 в 16:57
source

0 answers