# Do math with a FL (for loop)

I would like to know if there's any way to do math with the contents of a for loop. EX: \$fl(0,3,"i+1,"ci(ecount,a+i+d)","+"). This would simply print "0+1+0+2" (it however many event items you have per day).

What i want to do is actually add up those numbers. So instead, id lime the result to be "3"

I've tried escaping the + with \ or ' or by no adding quotation marks. I feel as if fl ONLY outputs text. It would be nice to be able to convert that text to numbers, or have another tool yo do it, like \$mu(sum,fl(0,3,"i+1","ci(ecount,a+i+d)",","))\$ so in essence it does \$mu(sum,0,1,0,2)\$ and outputs 3.

Otherwise, the next best thing is \$ci(ecount,a0d)+ci(ecount,a1d)+ci(ecount,a2d)+ci(ecount,a3d)\$ which is exactly what the fl() does, but this method is not very dynamic.

I figured this out. Well, I found the right source to figure this out. Thanks to @Tored and the #community-kode-database on the Kustom Discord server (https://discord.com/channels/359763545086230531/499728580108877827)

Seems like the key is to encapsulate the fl() in another fl() like this

``fl(0,0,0, fl(0, 3, "i+1", "ci(ecount, 0da+i+d)", "+"))``

This does exactly what I was looking for. so, im guessing the child for loop does the "0+1+0+2" and then the parent for loop (which doesn't actually loop, because there's no parameters for it to loop) sees the output as 0+1+0+2 instead of "0+1+0+2" (the difference being the quotation marks)