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
    • 1 yr 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

  • 1 yr agoLast active
  • 1Replies
  • 58Views
  • 2 Following