On Change of a Decimal attribute, round decimals in 10s.

0
Hi there,    Not sure how to best ask this question. But here it goes.    We have an attribute of type decimal for user to "log time" against an initiative.  I have an on change flow in place, but having difficulty with the calculation.    We want to make sure that time can only be entered in 10 minute increments.    e.g User enters: 1.15 (1 hour 15 minutes) - we want that rounding to 1.20.  If the user entered 1.14 - we want that rounding to 1.10.       
asked
3 answers
1

You can use the Round function - documentation here:  Round

 

One note:  10 minute increments of an hour are not an even decimal (i.e. 10 minutes is 0.16666666666666....)

answered
1

Hello Sven,

 

What happens when a user fills in 1.55 does it need to go to 2 ?

If so why not make life easy and let the user fill in the amount of minutes and round that one to the nearest 10 minutes so 112 to 120, 89 to 90, 81 to 80 etc.

 

Hope this helps,

 

Good luck!

answered
0

Thanks all, 

 

I eventually managed to figure out a solution to this. 

 

So I took the initial value and round that to 1 decimal. 

 

Then I took that variable value and updated the object but added 0.0 to it. 

 

This managed to get the result we're looking for which is : User enters 1.1 this must = 1.10

1.25 = 1.30

1.24 = 1.20 etc. 

 

 

answered