how to round

Coding-related discussion: OpenPPL (Poker Programming Language) and internal OpenHoldem-script
Post Reply
alexz99
First blood
First blood
Posts: 12
Joined: Fri Jun 12, 2020 8:11 pm

how to round

Post by alexz99 »

Can you tell me how to round up rates? so as not to put 138 but round up to 150 for example
Alex
Site Admin
Site Admin
Posts: 3112
Joined: Sun Mar 26, 2017 5:58 pm

Re: how to round

Post by Alex »

alexz99 wrote: Sun Jan 15, 2023 5:06 pm Can you tell me how to round up rates? so as not to put 138 but round up to 150 for example
you can easily round to closest INT number (like 2.76 to 3):

Code: Select all

(X + 0.5)^0
rounding to closest 50 number will be more tricky i think. Can you tell the application for it?

i think you can do:

Code: Select all

((X / 50 + 0.5)^0) * 50
Post Reply