I have a built custom search template for a SharePoint Online site collection to return results in a tabular form. The template works and returns the desired data but some of it is not in the format I want. The code is below:
<body>
<div id="Item_Default">
<!--#_
if(!$isNull(ctx.CurrentItem) && !$isNull(ctx.ClientControl)){
var id = ctx.ClientControl.get_nextUniqueId();
var itemId = id + Srch.U.Ids.item;
var hoverId = id + Srch.U.Ids.hover;
var hoverUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default_HoverPanel.js";
$setResultItem(itemId, ctx.CurrentItem);
if(ctx.CurrentItem.IsContainer){
ctx.CurrentItem.csr_Icon = Srch.U.getFolderIconUrl();
}
ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl);
ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();
_#-->
<div id="_#= $htmlEncode(itemId) =#_" name="Item" data-displaytemplate="DefaultItem" onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_" onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">
<table cellpadding="4" width="700px">
<tr>
<td width="20%" style="text-align:center">_#=ctx.CurrentItem.UPRNOWSNMBR=#_</td>
<td width="40%" style="text-align:center">_#=ctx.CurrentItem.FullAddress=#_</td>
<td width="20%" style="text-align:center">_#=ctx.CurrentItem.PlanningCategory_0=#_</td>
<td width="20%" style="text-align:center">_#=ctx.CurrentItem.PropertyUse=#_</td>
</tr>
</table>
<div id="_#= $htmlEncode(hoverId) =#_" class="ms-srch-hover-outerContainer"></div>
</div>
<!--#_
}
_#-->
</div>
</body>
The column UPRNOWSNMBR only contains whole numbers but it returns it's data with a decimal point like this: 12345.00000
I've created templates that alter data formats on the fly before (changing date format etc) but can't recall how I did it. How can I trim out the decimal point and everything after it leaving the number intact?