Skip navigation
Currently Being Moderated

Display numeric value as 0 if negative

Jan 25, 2007 1:54 PM

I just started working with Designer and am trying to put together a time sheet for our office. I would like to use a formula to calculate overtime hours (in excess of 8 hours/day). I tried using "regulartime - 8" as my formula but if the regular time is less than 8 I show a negative number in the overtime column. This then affects my weekly totals. Is there a way to have any value of 0 or less than zero (negative) display as "0"?

Thank you for any help you can give.
 
Replies
  • Currently Being Moderated
    Jan 29, 2007 1:27 AM   in reply to (Jeremy_Neufeld)
    i guess you could add a javascript to the calculate event of the field:

    //************
    if (this.rawValue < 0)

    this.rawValue = 0;
    //************

    or you could add something like this:

    //************
    if (regulartime > 8 )

    overtime = regulartime - 8;

    else

    overtime = 0;
    //************
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)