Depends what you want to achieve. For simple display purpose a function will do:
viewModel.calcTotal = function ( row ) {
return parseFloat(( row.total() * row.quantity() ), 10);
};
There is special variable in for
loop $data
that will pass your row data:
<td><span data-bind="text: $root.calcTotal($data)"></span></td>
Also, your first point with math in HTML will work if you add parentheses. Simple form of binding observables won't work in expressions.
data-bind="text: parseFloat(( total() * quantity() ), 10)"