# Calculate minutes

Hello smart people.  I am working on an interactive IV pump that needs to calculate durations based on weight/dose etc.  My one calculation will give me hours and decimals currently.  IE, 12.25 hours is 12 hours 15 minutes.  I know I need to get the remainder (0.25) and multiply by 60.  My question is how do I get the remainder from that calculation

Any help is appreciated.

Thanks

Tim

###### 3 Replies You can try dividing the total time by 10,000,000 and then multiplying it by 10,000,000. Since SL only keeps 7 digits after the decimal, that will strip off the decimal part. Since it rounds the 7th digit, you need to subtract .5 before you start. Subtract that result from the original number, and you'll have the decimal part.

See the attached sample. Afraid of that

One option would be to keep adding 0 until you find the upper limit of SL 360.

An easier option is to use Javascript.

Try the JS slide on the sample, but remember js won't run unless it is published.

Oops, I just realized I'm re-using some old code, and I called the variables minutes and seconds, and you wanted hours and minutes. Just a heads up.