Help with Formula for Hours Column

I’m using docugen to make a printable time sheet from my monday board. I have my start / end times in hours columns and found a formula from a guy that turns their difference into a decimal for the hours worked. This has worked great, except it gives and error when the start / end times are empty.

I thought it’d be an easy fix. Add an if statement for if the start / end time cells are empty, then show 0, otherwise figure out the math like normal. But I can’t for the life of me get it to work.

The if statement part works on it’s own, and the part that converts the hours column difference to a decimal works on its own. But I can’t get them to work together. Any ideas?

IF(
SUBSTITUTE(
HOURS_DIFF(
{Fri-2-End},
{Fri-2-Start}
),

		":",
		
		"."
)

<>0,

ROUND(

	SUM(
		ROUNDDOWN(
			SUBSTITUTE(
				HOURS_DIFF(
					{Fri-2-End},
					{Fri-2-Start}
				),

				":",

				"."
			),

			0
		),

		DIVIDE(
			(SUBSTITUTE(
				HOURS_DIFF(
					{Fri-2-End}, 
					{Fri-2-Start}
				),

				":",

				"."
			)

			-

			ROUNDDOWN(
				SUBSTITUTE(
					HOURS_DIFF(
						{Fri-2-End}, 
						{Fri-2-Start}
					),

					":",

					"."
				),

				0
			)),

			0.6
		)
	),

	2
),

0

)