Absolute value function in a template

3 posts, 1 answers
  1. Frederic
    Frederic avatar
    2 posts
    Member since:
    Jun 2012

    Posted 08 Jun 2012 Link to this post

    Hello,
    I'd like to print on the screen absolute values by a template.
    I've tried things like that :
    valueAxis: {
         labels: {
              template: "#Math.abs(value)#"
    }}

    or equivalent by using javascript and jquery but I couldn't find this out.
    Anyone can help ? Thanks !
  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 11 Jun 2012 Link to this post

    Hi Frederic,

    The right template syntax in your case is #= <js code> #, for example:
    columns: [
        {
            title: "foo",
            field: "foo",
            template: "#= Math.abs(foo) #"
        }
    ]


    I hope this information helps.

    All the best,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Frederic
    Frederic avatar
    2 posts
    Member since:
    Jun 2012

    Posted 11 Jun 2012 Link to this post

    Thanks !! That's it !
Back to Top