Round down
Forums › ProRealTime English forum › ProBuilder support › Round down
- This topic has 11 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
-
-
11/10/2018 at 6:29 PM #8455011/10/2018 at 8:31 PM #84552
Is below any help?
There is a also roundup and roundown
https://www.prorealcode.com/documentation/round/
11/10/2018 at 11:36 PM #84562Maybe this can help https://www.prorealcode.com/reply/41415/.
11/11/2018 at 12:27 PM #84599Hey,
No, this does not work – you can see in the examples it takes 2.8 up to 3.0. I need to round down 2.8 down to 2.
I dont see a rounddown function in the documentation. Is there some integerPortion() or roundDown() function I am missing?
Thanks,
David
11/11/2018 at 1:03 PM #84602To ALWAYS round down you have to subtract 0.4 from any number, while adding 0.9 ALWAYS rounds up.
1 user thanked author for this post.
11/11/2018 at 1:05 PM #8460311/11/2018 at 1:13 PM #84604Edit:
To ALWAYS round down you have to subtract 0.5 from any number, while adding 0.4 ALWAYS rounds up.
Sorry, I am on my mobile and couldn’t check the correct values.
11/11/2018 at 5:19 PM #84627Floor / Ceil value code snippet: https://www.prorealcode.com/topic/limitations-de-prorealtime/#post-34925
another one from Roberto 🙂 in this one: https://www.prorealcode.com/topic/round-downup/#post-41415
11/12/2018 at 1:38 AM #8465211/12/2018 at 10:26 AM #84673pointing out that there should be some for this functionality.
I agree … like under Help / ProBuilder Language Documentation ?
I’ll add Roberto code to the Snippet Library also as row 77.
2 users thanked author for this post.
10/12/2021 at 11:33 PM #179520Should 0.4 or o.5 be subtracted . If a number is 1.999 and I want this to round down then I need to subtract 0.5 otherwise if I subtract 0.4 giving 1.599 which ROUND (1.499)=2
I want to use this to calculate a contract size using STATEGYPROFIT
10/13/2021 at 12:30 AM #179522New instructions CEIL and FLOOR make all the above snippets obsolete.
https://www.prorealcode.com/documentation/ceil/
https://www.prorealcode.com/documentation/floor/
-
AuthorPosts