using System;
namespace FastReport
{
  public class ReportScript
  {
    public double MyCustomFunction(decimal amount, int quantity)
    {
      if (quantity == 0)
        return 0;
      else
        return ((double) amount / (double) quantity);
    }
  }
}
Comments
2. then call it from textobject
[MyCustomFunction([Products.Amount],[Products.Quantity])]