Round down

Tagged: , ,

Viewing 12 posts - 1 through 12 (of 12 total)
  • #84550

    Hey,

    Is there a simple way to return the integer value or round a value down? I cannot seem to find anything in the documentation, but please direct me if I have missed it!

    Thanks,

    David

    #84552

    Is below any help?

    There is a also roundup and roundown

    https://www.prorealcode.com/documentation/round/

     

    #84562
    #84599

    Hey,

    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

    #84602

    To 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.
    #84603

    Perfect. Thank you

    #84604

    Edit:

    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.

    #84627
    #84652

    Yes, already was a solution posted in this thread. I was more so looking for documentation or pointing out that there should be some for this functionality.

    Thanks though,

    David

    1 user thanked author for this post.
    #84673

    pointing 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.

    Snippet Link Library

     

     

    2 users thanked author for this post.
    #179520

    Should 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

    #179522

    New instructions CEIL and FLOOR make all the above snippets obsolete.

    https://www.prorealcode.com/documentation/ceil/

    https://www.prorealcode.com/documentation/floor/

     

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login