convert nulls to zero for template rendering