One cell in a Google Sheets document holds a value given by a SUM of cells formatted as "elapsed hours":"elapsed minutes". Attempting to make calculations in a custom script on this cell will throw errors. Further investigation using typeof() function will show this as "object". How can I convert the cell value to number? Attempted parseInt() or parseFloat() unsuccessfully.... In the linked sheet here you will see that:
- cell A1 having a formula that returns
288:00
formatted as duration, cell A2, having
=daysHrsMins(A1)
, that returns a negative value,-3.179.700.519.840.000,00
from the following function:function daysHrsMins(input) { return input*1440; }
Regional settings: Italy
Timezone settings: (GMT +1) Paris