The array looks like this:
const arr = [
{title: 'Cat1', val1: '0', val2: '20'},
{title: 'Cat2', val1: '0', val2: '30'},
]
I need the val1
and val2
to be converted into a number with two decimal places (eg. 0.00
, 20.00
), and then be able to pass the treated array (that includes everything else) in a different function.