Multi - Select Lookup Field

Multi - Select Lookup Field

Hello,
I am trying to add values of Multi-Select Lookup field and store them in another field
Value should be updated On User Input
Following is the code i used to add values
  1. var = 0.0;
  2. for each  rec in Quantity
  3. {
  4. if(Quantity.size()>0)
  5. {
  6. var = var + Quantity.todecimal();
  7. }
  8. }
  9. input.Total = var;

Values inside the Multi-Select lookup field are all decimal values

Following is the error i received :