Support Board
Date/Time: Wed, 22 Jan 2025 00:28:06 +0000
Post From: is there any ACSIL function that rounds
[2018-08-14 15:03:32] |
WarriorTrader - Posts: 245 |
The fastest way to round something is to add .5 and only take the integer part of the answer. I will have to look for some code examples but the ides is simple. To round 3.7 just add 3.7 + .5 which gives 4.2 and throw out the .2
to round 3.7 --> 3.7 + .5 = 4.2 = 4 That technique can be used for decimal places also. Add .005 to the number then truncate the result at the second decimal place. A C++ function probably exists to accomplish what you want, but if you can't find one the method I descried will work. --WT |