const COIN_LABEL = "€" // "taler" , "\$", points
let elInformationBody = $('#information tbody')
// set information table
$(document).ready(function () {
// var information is sent to informed traders
if (typeof js_vars.informed !== 'undefined' && js_vars.informed === true) {
let information = js_vars.information
elInformationBody.html(information.map(e => `
| ${e[2]} coins of | ${coin([e[1]])} | ${coin(e[3])} |
`).join(''))
}
$('#information tbody tr').filter(function() {
return isNaN($(this).children('td').eq(0).attr('value'));
}).html(` | `);
})
function coin(amount) {
//return `€${parseFloat(amount).toFixed(2)}`;
let value = parseFloat(amount).toFixed(2)
if (Number.isNaN(value))
{
return amount
}
return `${COIN_LABEL}${value}`
}