Pages:
Actions
  • #1 by ryan on 19 Feb 2018
  • Hi

    The % operator is not working.

    When I test it in the User Variables 
    balance % 5

    I get 1000%5 not a number.

    Using it to add "change" (less than a minimum bet) to the next bet.
  • #2 by mcbee on 19 Feb 2018
  • hi
    sorry but balance%5 is not a formula.
    to get 5% of your balance you would have    (balance/100)*5
    the 5 is the percent that you want so if you want more or less percent then alter the 5 only.

    mcbee
  • #3 by ryan on 19 Feb 2018
  • Hi thanks for that.

    I am actually looking for the Modulus not 5% as per page 159, 8.4.8 of the manual. (% modulus or remainder. For example, 5 % 4 = 1, 36 % 6=0, 23 % 7 = 2)

    So Australian Minimum Bet is $5. So if Balance = 103.50, Balance % 5 would equal 3.50 (so I can add $3.50 on to $5 for a total bet of $8.50)
  • #4 by mcbee on 19 Feb 2018
  • hi
    sorry i never use the % modulus , only seems to work with round numbers not 103.50.
    but if you need to use it i have come up with a formula that will give the correct result.
    (integer(balance))%5+balance-(integer(balance))

    first it rounds the number then does the % modulus calculation then adds the .xx value.

    mcbee
  • #5 by ryan on 19 Feb 2018
  • Thanks for that.
  • #6 by Oxa (WellDoneSoft) on 20 Feb 2018
  • Hello!

    Mcbee is right, the modulo operator only works with integer numbers.
Pages:
Actions