Pages:
Actions
  • #1 by flanna on 07 Jan 2013
  • I' d like to round up calculated values in a trigger to 2 decimal points.

    In a spreadsheet I would use something like "ROUND(1.2345,2)". Which would return 1.23 .

    Is there a way to do this in a trigger calculation?
  • #2 by Tim (WellDoneSoft) on 07 Jan 2013
  • What do you need this function for?
  • #3 by flanna on 07 Jan 2013
  • What do you need this function for?

    For rounding numbers up or down. i.e. to 2 places 1.79 rounds up to 2 and 1.11 rounds down to 1.
  • #4 by Tim (WellDoneSoft) on 07 Jan 2013
  • Yes, I know what's the function for.
    I mean what's your aim?
  • #5 by flanna on 07 Jan 2013
  • Yes, I know what's the function for.
    I mean what's your aim?

    The aim is that to round bet amounts up or down to the nearest 50 cent.

    So when the trigger constants have been used to calculate a bet, and it comes to a strange amount (i.e. 2.3759) the bet will be rounded (i.e. to 2.5 or 2.0)
  • #6 by Tim (WellDoneSoft) on 07 Jan 2013
  • INTEGER(my_val) + IF(INTEGER(my_val*100)/100 - INTEGER(my_val) < 0.5, 0, 0.5)
  • #7 by flanna on 07 Jan 2013
  • INTEGER(my_val) + IF(INTEGER(my_val*100)/100 - INTEGER(my_val) < 0.5, 0, 1)

    Thanks for that. It's certainly more complex than the standard spreadsheet ROUND() function though.

    Is there a list of supported functions?
  • #8 by Tim (WellDoneSoft) on 08 Jan 2013
  • Help -> Triggered Betting -> Reference -> Operators and Functions
Pages:
Actions