Here's a snippet of code for creating a heat-map in Kendo UI.
<div ng-repeat="h in row.hours" ng-style="h.styleStr"
data-value="{{params.compare ? h.percentChange : h.current[unit]}}"
data-time="{{$index}}">
{{params.compare ? h.percentChange : h.current[unit]}}
</div>
The code is working smoothly. The h.current[unit]
inside the div displays the value in decimal format, like this..https://i.sstatic.net/sXX65.png
However, I now need to display these values as integers, like this...https://i.sstatic.net/ahgao.png
I have an intFormat
function that can convert decimal to integer. For example:
intFormat(79.952)
will return 80
. So, I'm attempting to use the intFormat function to format the numbers inside the heatmap. How can this be achieved? Can functions be used within double curly braces like this:
{{params.compare ? h.percentChange : intFormat(h.current[unit])}}
? I am using AngularJS 1X and KendoUI.