Author Topic: Is there a ROUND function?  (Read 2766 times)

Tags:
  • All members
  • Posts: 68
  • Karma: +0/-2
Is there a ROUND function?
« on: Mon, 07 January, 2013, 15:35 »
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?

  • Tim Vetrov
  • Administrator
  • Posts: 3901
  • Karma: +151/-0
  • Gender: Male
*
Re: Is there a ROUND function?
« Reply #1 on: Mon, 07 January, 2013, 16:56 »
What do you need this function for?
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду раз помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 68
  • Karma: +0/-2
Re: Is there a ROUND function?
« Reply #2 on: Mon, 07 January, 2013, 17:14 »
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.

  • Tim Vetrov
  • Administrator
  • Posts: 3901
  • Karma: +151/-0
  • Gender: Male
*
Re: Is there a ROUND function?
« Reply #3 on: Mon, 07 January, 2013, 18:27 »
Yes, I know what's the function for.
I mean what's your aim?
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду раз помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 68
  • Karma: +0/-2
Re: Is there a ROUND function?
« Reply #4 on: Mon, 07 January, 2013, 19:23 »
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)

  • Tim Vetrov
  • Administrator
  • Posts: 3901
  • Karma: +151/-0
  • Gender: Male
*
Re: Is there a ROUND function?
« Reply #5 on: Mon, 07 January, 2013, 20:22 »
INTEGER(my_val) + IF(INTEGER(my_val*100)/100 - INTEGER(my_val) < 0.5, 0, 0.5)
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду раз помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 68
  • Karma: +0/-2
Re: Is there a ROUND function?
« Reply #6 on: Mon, 07 January, 2013, 20:25 »
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?

  • Tim Vetrov
  • Administrator
  • Posts: 3901
  • Karma: +151/-0
  • Gender: Male
*
Re: Is there a ROUND function?
« Reply #7 on: Tue, 08 January, 2013, 14:50 »
Help -> Triggered Betting -> Reference -> Operators and Functions
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду раз помочь с понедельника по пятницу, 08:00-18:00 GMT