Examples: NumberDigits property (ViewColumn - Java)

This agent toggles the number of decimal places for numeric values in a column from 0 through 6.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View view = db.getView("All Documents");
      ViewColumn vc = view.getColumn(6);
      if (vc.getNumberDigits() >= 6)
        vc.setNumberDigits(0);
      else
        vc.setNumberDigits(vc.getNumberDigits() + 1);
      System.out.println("Number of decimal digits = " +
        vc.getNumberDigits());
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}