Remove numbers after the decimal point

Forums ProRealTime English forum ProBuilder support Remove numbers after the decimal point

Viewing 7 posts - 1 through 7 (of 7 total)
  • #222699

    Hi, Another question from a hopeless programmer.

    I have tried to remove (or hide) the numbers after the decimal point for the Bull/Bear volume indicator (picture).

    I added the comment ‘Decimal [0]’ to the code, but without result. Can anybody help me out?

    Here is the code:

     

    #222704

    Topic moved from proscreener forum to probuilder forum

    Round, or Floor, or Ceil… depending on if you want closest integer, integer below, or integer above…

    Examples:

    round(mmred)

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

    Ceil(mmred)

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

    Floor(mmred)

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

    #222706

    ????? Just want to remove the decimals as shown on the attached picture. Sorry but your reply make no sense to me.

    #222708

    First, delete both complete=decimal[0] lines, they don’t do anything

     

    Second, replace the return line (number 22) with this one instead, adding everywhere inside it the ROUND keyword from above reply :

    return ROUND(volbear) coloured (204,0,0) style (histogram), ROUND(volbull) coloured (0,51,153) style (histogram), ROUND(mmred) coloured (204,51,0) as “Bear average”, ROUND(mmgreen) coloured (0,51,153) as “Bull average”

    1 user thanked author for this post.
    #222720
    JS

    Hi Marcel,

    There is no instruction in PRT to remove the decimals…

    What you can do is use the instruction Round(a, digits) (as JC indicates), with which you can round the number to the nearest whole number and optional indicate with “digits” how many decimal places you want to see…

    1 user thanked author for this post.
    #222744

    Marcel, in case it is not clear …

    #222820

    I copied/paste the suggestion return rule from the reply of #JC Bywan and it works fine. Thanks for your thoughts ……….

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

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