Javascript is used on the web interface. If you need to compute process variables, then use Freemarker script.
For this particular use, I would prefer to compute percentage on web interface using javascript.
If you are using an array widget on web interface with "name" and "money" columns, then you can create an additional column with type of widget "javascript" and configure widget for this column to write a script that can "listen to variables" (money,value)
and use their value to calculate the percentage compuation.You can change the visiblity of this column to invisible if needed.
"value" can be a variable for number input widget where you can set default value to 100 or ask the user to input.
JS to calculate percentage :
[[money]]/[[value]];
If you need to compute this as a process variable in the process then you need to write a freemarker script that iterates through the arraylist and calculates the percentage compuation.
Freemarker script to calculate percentage :
${money?number/value?number};
Thanks,
Pray Desai
Solutions Architect, Global Software Center