Forum Discussion
Convert decimals to a time column
- 3 years ago
Hi laurent_dec
Does this help?
xColumn = FORMAT( [xx_starting_time] / 24, "long time" )Also, look for blank or negative values in the different parts of your column definition as that will raise the error you received.
Hello laurent_dec,
xx_starting_time_reformat = FORMAT(TIME(0,ROUND(KPI_ODOO_account_analytic_line[xx_starting_time]*60,0),0),"long time")
In the above, the ROUND function is used to convert the decimal value to the nearest minute by multiplying the value by 60, rounding to the nearest integer, and then dividing by 60 again to convert it back to a decimal value representing minutes. The TIME function is then used to format the result as a time value.
I hope this helps resolve the issue you were facing. Let me know if you may need any further assistance.
Hello Sahir_Maharaj ,
Thanks for your feedback.
The time format for the decimale is like this:
Another example: 1,1667 = 1 hour and 10 minutes
So, before the comma are the hours, simple.
After the comma are the minutes, but on a scale of 100 instead of 60.
In your formula, don't I need to substract the 1 before the comma?
Thanks, Laurent.
- grantsamborn3 years ago
Solution Sage
Hi laurent_dec
Does this help?
xColumn = FORMAT( [xx_starting_time] / 24, "long time" )Also, look for blank or negative values in the different parts of your column definition as that will raise the error you received.- laurent_dec3 years agoFrequent Visitor
Hi grantsamborn , thank you so much, works perfectly and super simple. You don't wanna know what complex formulas I have tried :). 🙏🏻