I'm doing a push to get fed into Google Analytics and one of the guidelines that prices are returned as float, so that's fine I've managed to solve using parseFloat (), however, they need two decimal places up to values that end with 00. Ex: (100.00 or 208.00). When it returns a float value it removes values that end with 0.
var product_price = “100.00”; value = parseFloat(product_price);
resultado = 100
I used the .toFixed (2) method to place the two decimal places but return as String.
Well, I've already researched several places and all the solutions I found and the ones I know returno string. I believe that technically it is not possible. But I would like a certainty.
Could you tell me if it is possible to return a value with two decimal places for final values of .00.
Just to make it clear that parseFloat returns a value with a floating point such as 100.99, now for a 100.00 no.
Thank you.