0

how trasform a time interval into a number?

How can I calculate the cost of a working day by multiplying the number of hours worked by the hourly price?

1 reply

null
    • Fred
    • 3 yrs ago
    • Reported - view

    Hi Luca -

     

    To see how Ninox works with date/time you can do the following:

    Assuming you have datetime fields called ClockIn and ClockOut

    1) create a formula field (HrsWrkd) with number(ClockOut - ClockIn)

    You will see a really big number. This is because Ninox really keeps track of date/time in milliseconds. If you go back and remove number you will see Ninox translates the miliseconds into a human friendly display, but it is only a display Ninox is using miliseconds.

    2) create a formula field (ConvertHrsWrkd) with HrsWrkd/3600000

    This formula will convert the miliseconds in HrsWrkd into hours and now you can use this to do your calculations for pay.

     

    Once this makes sense you can put it all into one formula if you want. It would look something like:

     

    let hoursWorked := ClockOut - ClockIn;

    hoursWorked/3600000

     

    Good luck and let us know how it goes.