Forum Academy Marketplace Showcase Pricing Features

How to: Perform calculations on numbers in a repeating group?

Hi everyone!

I want to show the total payout for a PARLAY bet—for example I might bet that Man United AND Man City win their next soccer game; both events must be true to win. The odds are from an API and are in a repeating group.

Here’s an example! Let’s say a user chooses two events: +300 and –145 odds, respectively.

  1. First, Bubble must convert these american odds into decimal odds. For Positive odds (+300), the formula is: (1 + (+300/100)) = 4.00. For Negative odds (–150), the formula is: (1 – (100/–150) = 1.67.

  2. Decimal odds must be multiplied together. In our example, we do (4.00 * 1.67) = 6.67.

The last part is simple—we can just multiply 6.67 by the user’s inputted bet to get the payout.

Thank you so much if you can help! –Drew

My “trick” is to use inputs set as integers

In your case

// positives 
Input 1s Val = this cell’s positive value / 100
Input 2s Val = input 1’s Val + 1

// negatives
Input 3 Val = 100 / this cells negative value
Input 4  val = 1 - input 3’s Val

// the bet
Input 5 = input 2 ‘s Val* input 3’s val

Awesome I’ll give it a try! Thanks!