• Resolved Sportuojantys

    (@needfeed)


    Hello, I have problem with calculator, that it would understand my operation as 24 hour format number.

    User selects the number from dropdown (from ’10’ to ’15’, this is an hour on which they start eating breakfast, while doing intermittent fasting) and calculator show intermittent fasting time (16 hours period, while they can’t eat anything)

    (function(){
    var result = (fieldname11+8);
    var resultt = (fieldname11+16);
    var resulttt = CONCATENATE (‘intermittent fasting time is from ‘,result, ‘ hour, to’, resultt, ‘ hour’);
    })()

    Is there a way to make sure that calculator understands, that answer shouldn’t be up to “24” and if number is bigger, then it should be ’00’ to ’24’ hours?

    Thanks in advance ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @needfeed

    Thank you very much for using our plugin.

    You can implement the equation as follows:

    (function(){
    var result = (fieldname11+8);
    var resultt = (fieldname11+16);
    
    if(24<result) result = result - 24;
    if(24<resultt) resultt = resultt - 24;
    
    return CONCATENATE ('intermittent fasting time is from ',result, ' hour, to', resultt, ' hour');
    })()

    Best regards.

    Thread Starter Sportuojantys

    (@needfeed)

    Wow, thanks, it’s working fine! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hours format’ is closed to new replies.