# Function extractNumberField

- extractNumberField(
  payload: Record<string, unknown>,
  field: string,
  defaultValue?: number,
  ): number

  Extracts a number field from a payload object safely.

  #### Parameters

  - payload: Record<string, unknown>

    The payload object to extract from

  - field: string

    The field name to extract

  - defaultValue: number = 0

    Default value if not found

  #### Returns number

  The number value or default if not found/invalid

  - Defined in packages/nexus-agents/src/agents/observability/orchestration-observer-helpers.ts:46