I have a problem with decimal places. My code gives me the result 123 123 12, while I need to display the result in the form 12 312 312.
Can anyone help setting this formatting?
Code here:
var fcqInteger = parseInt(fcq.replace(/\s/g, ''));
valPrice = parseFloat(valPrice.replace(',', '.'));
var marketCap = (fcqInteger * valPrice)+'';
// result
var marketCapParts = marketCap.match(/[\s\S]{1,3}/g) || [];
marketCap = marketCapParts.join(' ');
Thanks for help.
fcqandvalPrice?valPrice?