Hours Worked column not totalled correctly

  • 19 March 2019
  • 1 reply
  • 1 view

Userlevel 3
Badge +16

Hi,

 

Editable list has column called "Hours Worked" set to  (decimal with 2 places)

 

For example Start Time i have 08:55 am, End Time is 12:00 pm

The time difference is calculated as 3.08 Hours and put in the "Hours Worked" Column

 

I then go and have a column with a Hrly Rate of £10.23 which calculates total payable as £31.54 (this is wrong, it should be £31.51)

 

Although the Hours Worked column displays to 2 decimal places (3.08 hours), if you double click on column it shows: 3.08333333333333333333

 

How can i make the actual figure in the column to 2 decimal places (not just display time) ???? I think the Hours Worked is using the underlying 3.08333333333333333333 to calculate rather than the rounded 3.08 figure...

 

I am using an expression to populate the Hours Worked as follows:

 

Date/time Difference (hour, End Time, Start Time)

Do i need something in the above expression to round to 2 decimal places perhaps?

 

Any ideas


1 reply

Hello,


 


Have you considered using an additional expression and operator prior to making the calcuation for the total pay?


 


There is a mathmatical operator "Format Number" that should be applicable in your use case: 


https://help.k2.com/onlinehelp/k2five/userguide/5.1/default.htm#Create/Views/ControlExpressions.htm#format_number


 


Hope that helps!


 

Reply