Hey, <cms:add /> tag is very comfortable to add 2 numbers:
For VERY many numbers it's better to have a smarter method with another tag.
But both tags don't help for very easy task of getting a sum of, say, just 4 numbers.
it's pretty ugly to add 4 numbers at once with default <cms:add/> tag. It would look like that:
Simple mod, placed in kfunctions.php allows to make unlimited adds like this:
Comfy!
- Code: Select all
<cms:add '1' '2' />
For VERY many numbers it's better to have a smarter method with another tag.
- Code: Select all
<cms:set total='0' />
<cms:set huge_line = '1,2,3,4,5,6,7,8,9,10,11,12' />
<cms:each huge_line sep=',' as='next_number'>
<cms:incr total next_number />
</cms:each>
<cms:show total />
But both tags don't help for very easy task of getting a sum of, say, just 4 numbers.
it's pretty ugly to add 4 numbers at once with default <cms:add/> tag. It would look like that:
- Code: Select all
"<cms:add '1' "<cms:add '2' "<cms:add '3' '4' />" />" />"
Simple mod, placed in kfunctions.php allows to make unlimited adds like this:
- Code: Select all
<cms:add '1' '2' '3' '4' />
Comfy!