You are viewing limited content. For full access, please sign in.

Question

Question

24 hour time using a function

asked on December 17, 2024

Hi,

this has problem has probably been answered elsewhere but I can't find it.  Using 24 hr. time, why do I get this?:

The "Total Event Time:" is a single line field

This is the function I've tried:

I'm not sure this is even correct.

I'm in LF11.0.2307.40547 

Any help would be greatly appreciated.

Donnie

0 0

Answer

SELECTED ANSWER
replied on December 18, 2024

It Helped! Thanks so much!

0 0

Replies

replied on December 17, 2024 Show version history

Just curious, is there a reason you're using a single line field as opposed to a number field for your "Total Event Time:"? I tested this with a number field and it's working as expected. (5 or 5.00000 etc. depending on the number of decimals set in the advanced tab.)

 

Editing to add: If you need/want to use a single line field, you can change your formula to:

=ROUND((SUB(time_depart,time_arrive)*24),2)

That will round the value to 5, or include up to 2 decimal places if needed. (Just change the 2 if you want more or less.)

5 0
replied on December 18, 2024 Show version history

Sarah,

Thanks for the help.  I have 2 more questions:

How do I blank out the Event Time line until I fill in the departure line?

How do I deal with times that aren't whole hours as shown below:

I guess it has to do with ROUND???

Also, I switched to a Number line instead of Single Line.

Donnie

0 0
replied on December 18, 2024

Regarding hiding the event time field until departure time has been filled in, I would just use field rules. Here's an example of how you could set it up:

Note that I'm on Cloud, so I don't know what options you have on version 11, but assuming you can do something similar.

Re partial hours, I would personally add 2 decimal places so you can have half hours and quarter hours reporting correctly. This can be set under the advanced tab for a number field.

Hope this helps!

1 0
SELECTED ANSWER
replied on December 18, 2024

It Helped! Thanks so much!

0 0
replied on December 17, 2024 Show version history

This is likely just an arithmetic precision error (which is not unheard of in computer calculations) and not actually an issue with Forms itself.  I've seen this kind of stuff happen in Excel and programming languages from time to time.  The best course of action is to do as @████████suggested and round off the value to a small number of decimal places.

3 0
You are not allowed to follow up in this post.

Sign in to reply to this post.