Kendo Template - Convert boolean value into yes or no

1.6k Views Asked by At

I have this kendo template and i am trying to convert the isDiscount boolean value into yes/no. Please suggest how can i perform this conversion.

 <script type="text/x-kendo-template" id="template">
            <div id="details-container">
                <h2>#= Name # </h2>
                <em>#= Description #</em>
                <dl>
                  <dt>Price: #= kendo.toString(Price, "c")#</dt>                
                  <dt>Discount available: #= isDiscount #</dt>
                </dl>
            </div>
      </script>
1

There are 1 best solutions below

2
On BEST ANSWER

You can use the conditional conversion inline like that:

<dt>Discount available: #if(isDiscount){# Yes#} else {# No#}#</dt>

There is also a demo here