Currently, I am in the process of calculating my totals and I need to ensure that they are fixed to 2 decimal places. Here is a snippet of my code:
this.selectedCompaniesDetails.forEach((company) => {
if(company.id == p.company_id)
{
if (!tot[p.company_id])
{ tot[p.company_id] = [] }
const numberPrice = parseFloat(p.price)
tot[p.company_id].push(numberPrice)
}
});
However, I am facing an issue with the parseFloat(p.price) function which seems to be returning strange values. To visualize this problem better, take a look at my screenshot below. https://i.sstatic.net/doAgf.jpg