Display decimal time in hh:mm format

When using the zapier ‘Create Time Activity in Quickbooks Online’ trigger, it is required you post the time in hh:mm format. My time tracker returns decimal time, so I developed this formula to convert (where hours is the decimal value):

  if(thisRow.hours.Split(".").First()<10,
    concat(0,thisRow.hours.Split(".").First()),
    thisRow.hours.Split(".").First()
  ),
  ":",
  if(
    thisRow.hours.Split(".").Last().Quotient(100).Product(60)<10,
    concat(
      "0",
      thisRow.hours.Split(".").Last().Quotient(100).Product(60).round(0)
    ),
    thisRow.hours.Split(".").Last().Quotient(100).Product(60).round(0)
  )
)
1 Like