# Re: \$/hour formula only giving (incorrect) cents instead of whole dollar amount?

Solved
583 0
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

Good morning!

I am trying to determine how much I am making per hour at various markets that I vend.

I input my markets with a start date+time field and an end date time field and have that calculate out to a duration field.

I also have my earnings field (which is what I made minus event fees, also calculated out).  *it's the "Minus Fees" column I'm using for my final calculations

Logically, I should just be able to do my earnings / duration = dollars per hour amount
or in my chart's terms:
{minus fees} / {duration (show)} = \$ per hour amount

However, instead of getting a nice dollar value, this is what I see:

I feel like I'm missing something incredibly obvious here because obviously,
\$1,124.17 / 7 hours does not equal \$0.04 cents.
It should be \$160.56.

Can someone spot where I've gone wrong?

Thanks!

2 Solutions

Accepted Solutions
18 - Pluto

Thanks for the screenshots.

It looks like you do not have units for your DATETIME_DIFF() formula. Since you want to display the result as a duration, you should explicitly use “seconds” as the units.

Duration fields are stored as a number of seconds. If you want dollars per hour, you need to convert seconds to hours. 1 hour is 3600 seconds.

Notice that \$160.56/hour is the same as \$0.0446/second, which rounds to \$0.04

11 - Venus

"Duration Format" is the number of seconds.
For 7 hours, this would be 25200 seconds.

To convert seconds to hours, it needs to be multiplied by 3,600.

``{minus fees} / {duration (show)} * 3600``

4 Replies 4
18 - Pluto

Thanks for the screenshots.

It looks like you do not have units for your DATETIME_DIFF() formula. Since you want to display the result as a duration, you should explicitly use “seconds” as the units.

Duration fields are stored as a number of seconds. If you want dollars per hour, you need to convert seconds to hours. 1 hour is 3600 seconds.

Notice that \$160.56/hour is the same as \$0.0446/second, which rounds to \$0.04

5 - Automation Enthusiast

Oh!  Thank you so much - I had previously looked up the datetime_diff() and someone had mentioned not to include units!

(Also didn't even consider that it was dividing by seconds, good catch!)

11 - Venus

"Duration Format" is the number of seconds.
For 7 hours, this would be 25200 seconds.

To convert seconds to hours, it needs to be multiplied by 3,600.

``{minus fees} / {duration (show)} * 3600``

5 - Automation Enthusiast

This is actually what I ended up doing!