I'm doing a push to be fed into Google Analytics and one of the guidelines that prices are returned as float, so far so good. I solved using parseFloat (), however, I have to return two decimal places for values that end with 00. Example: (100.00 or 208.00). When it returns a float value it removes values that ends with 0.
var product_price = “100.00”; value = parseFloat(product_price);
Result with float= 100
I used the .toFixed (2) method to place the two decimal places but return as String.
Well, I already researched in several places and all the solutions that I found and those I know will return a string. I believe that technically it is not possible. But I'd like to make sure it's really not possible.
Saberiam me dizer se é possivel retornar um valor com duas casas decimais para valores de final .00.
To clarify the parseFloat return a value with floane point like 100.99, now for a 100.00 not.
Sorry to write the question in Portuguese before.
Thanks