0

duration() format?

I'm using duration() to find the duration of an appointment. However, it always displays as h:mm.

I've tried all kinds of format() and can't get it to show as just h. Everything I've tried always shows "12".

Ideas?

1 reply

null
    • Fred
    • 2 yrs ago
    • Reported - view

    That is kinda weird. There probably is some good explanation. Maybe it is because it is a time format and Ninox doesn’t know what to do when you try to format what is really a string into a time format.

    If you do:

    debugValueInfo(duration(appoinmentfield ))

    It will say string(value), so duration() returns a string not a number.

    One way to get what you want is to use the raw() command then divide by 3600000 (the number of milliseconds in an hour). Of course then you have to add the round() function as well.

    round(raw(duration(appointmentfield))/3600000,0)

Content aside

  • 2 yrs agoLast active
  • 1Replies
  • 88Views
  • 2 Following