1 Reply Latest reply on Mar 19, 2015 1:16 PM by Sean.twyman

    Custom format script for $0.00

    Sean.twyman

      I have a text field that has a custome format script to give the user information regarding what goes in this field.

      // Custom Format script for text field
      if (!event.value) {
      event.value = "TYD Total";
      event.target.textColor = color.ltGray;
      event.target.display = display.noPrint;
      } else {
      event.target.display = display.visible;
      event.target.textColor = color.black;
      }
      

      What i need though is the "else" portion needs to be formatted as a number with 2 decimal points and a $ at the front. and that should be the only format that user can enter. Can anyone help me out please.

        • 1. Re: Custom format script for $0.00
          Sean.twyman Level 1

          Actually i figured it out

          // Custom Format script for text field
          if (!event.value) {
          event.value = "Your Message Here";
          event.target.display = display.noPrint;
          event.target.textColor = color.gray;
          } else {
          AFNumber_Format(2, 0, 0, 0, "$", true);
          event.target.display = display.visible;
          event.target.textColor = color.black;
          
          
          }