1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

%@average

Discussion in 'Support' started by Samuel Krepelka, Jul 22, 2017.

Tags:
  1. Samuel Krepelka

    Joined:
    Jul 22, 2017
    Messages:
    1
    Likes Received:
    0
    [D:\]echo %@average[1 3 6 8 10 13 15]
    1368101315,0

    [D:\]echo %@average[1 3]
    13,0

    [D:\]echo %@average[1.0 3.0]
    TCC: (Sys) Parametr není správný.
    "%@average[1.0 3.0]"

    [D:\]echo %@average[1,0 3,0]
    1,0
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    Not reproducible here.

    How have you defined your decimal and thousands separator characters?
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    I'm not sure what to expect. I get these, the first with "auto" and the second with "Comma".
    Code:
    v:\> echo %@average[1,0 3,0]
    20.0
    
    v:\> echo %@average[1,0 3,0]
    20,0
    
    And the first of these (below) could use some tidying up. It doesn't seem to be coming from @EVAL.
    Code:
    v:\> echo %@average[1.1 3.1 0.1 2.1]
    1.6000000000000001
    
    v:\> echo %@eval[(1.1 + 3.1 + 0.1 + 2.1) / 4]
    1.6
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    WAD; it's interpreting the ',' as a thousands separator (and ignoring it).

    @AVERAGE doesn't use (or have any relationship with) @EVAL.
     
    #4 rconn, Jul 22, 2017
    Last edited: Jul 30, 2017
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    I'm surprised. Nevertheless, that example could use some tidying up.
     

Share This Page