Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4333 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi there,

 

I'm currently developing an ongoing solution where I have used decimal times.

ie. 1.5 = 1hr 30mins, 3.75 = 3:45 etc.

 

The reason I used decimal was clear to me at the time :sad:  but now I would like to dispay the resulting calculation in "proper" time format.

 

I could probably nut it out using some convoluted method but was hoping that someone has a more elegant solution.

 

Cheers,

Steve.

Posted

You could take everything after the decimal  x .6

thus  .75 x .6 = .45

drop the decimal and add it to th first part of the number

  • Like 1
Posted

If you are using an additional calculated time field to display in time format, this calculation will work for you:

timeAsHoursDecimal * 60

 

A FileMaker time field stores time as a number of seconds.

  • Like 1
  • Newbies
Posted

Thanks all.

 

dansmith, your solution was what I was after, with a minor tweak:

timeAsHoursMinsDecimal * 60 * 60

Then formatted in 24hr notation as Hrs:Mins

 

Seems to work just fine - I all makes sense now, I think.

 

I took the time to go back to the related table and realised that I originally divided the time by 60 to get to decmal!! :o

The reason being that the number had to be multiplied by "$hourlyRate" which I didn't think would work with time format. ie "time * $hourlyRate"

 

But It may well work fine that way, and just shows my ignorance and inexperience.

 

Anyway, the upshot is at worst I have a couple of unnecessary calculations. Which I don't particularly like the idea of redundant code.

 

I may relook into it only for my own understanding, but are loath to change it in case it causes a "domino or house of cards effect"... so perhaps the old adage "If it ain't broke, don't fix it" should be adhered to?

 

Cheers.

 

Posted

:blush2: oops!  that was an embarrassing mistake - I'm glad you got it to work for you.

 

I may relook into it only for my own understanding, but are loath to change it in case it causes a "domino or house of cards effect"... so perhaps the old adage "If it ain't broke, don't fix it" should be adhered to?

I find that using a database analysis tool like Goya's BaseElements or Beezwaxes Inspector is the key to preventing an unexpected "domino effect". It allows you to search for all references to the field (provided you are not using indirection methods). You can also do this by using the DDR directly, but an analysis tool is much easier to use if you have to do it often.

This topic is 4333 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.