JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<div id="VMDiv">
<table>
<thead>
<tr>
<th>Raw</th>
<th>Formatted</th>
</tr>
</thead>
<tbody>
<tr>
<td data-bind="text : SomeData "> </td>
<td data-bind="text : formatPercent(SomeData())"> </td>
</tr>
</tbody>
</table>
</div>
JavaScript
function formatPercent(value) {
return value.toFixed(2) + "%";
}
function vm() {
var self = this;
self.SomeData = ko.observable(62.1795972898);
}
ko.applyBindings(new vm(), document.getElementById("VMDiv"));