Hi all,
I need to validate the decimal value of number to be 0,25,5 and 75. Please help on this.
I need to validate hours and hours should be 1.5,1.25,1.75,1 . Value should not be like 1.30,1.35
1,25 % 0,25 = 0
1,3 % 0,25 = 0,05
if it needs to be in quarter value increments what if you got the modulo (remainder) of 0.25
if ((mynum % .25) <> 0) { /*error it's not divisible by .25*/ }
note Andrey got there first
Thanks Andrew and Lee .. I tried the below code
I had the code in config console in user action - Entry rule
if (Hours > 0) constraint ((Hours % .25) = 0) "minutes_should_be_0,25,50,75"
Getting the LPL constraint while saving the code
"Employee" Error : Expected a logical operator.> constraint ((Hours % 0.25) not entered)
if (Hours > 0)constraint ((Hours % .25) = 0)"minutes_should_be_0,25,50,75"
Out of curiosity, what is the use case for supporting fractional hours then limiting the value to quarter hour intervals?
you question did not mention this was LPL, using modulo is a general solution, I can't suggest one that works as a LPL constraint
Sorry.. It was my mistake.. We need in config console
Its business requirement.. I am not aware of the cause.. I am technical