Formato hhmmss

Hi @Santi98

The formula looks mostly correct for converting seconds into an HH:MM:SS format, but let’s optimize it and ensure it handles cases correctly.

  • Parentheses and Operator Precedence: Ensure that division and modulus operations are correctly grouped with parentheses to avoid calculation errors.

  • Ensure the field is consistently numeric and doesn’t have unexpected decimals.

Try the below formula

concat(
  ifelse(floor(({Segment Duration Seconds}) / 3600) < 10,
    concat('0', tostring(floor(({Segment Duration Seconds}) / 3600))),
    tostring(floor(({Segment Duration Seconds}) / 3600))
  ),
  ':',
  ifelse(floor(({Segment Duration Seconds}) % 3600 / 60) < 10,
    concat('0', tostring(floor(({Segment Duration Seconds}) % 3600 / 60))),
    tostring(floor(({Segment Duration Seconds}) % 3600 / 60))
  ),
  ':',
  ifelse(({Segment Duration Seconds}) % 60 < 10,
    concat('0', tostring(({Segment Duration Seconds}) % 60)),
    tostring(({Segment Duration Seconds}) % 60)
  )
)
1 Like