Number Responses

Number responses allow reviewers to input precise numeric values with customizable validation, formatting, and display options. They’re perfect for collecting prices, quantities, measurements, scores, or any numeric data that requires accuracy and consistency.

When to Use Number Responses

Number responses are ideal for:

Pricing & Financial

Setting product prices, budget amounts, cost estimates, or any monetary values requiring precision

Quantity & Inventory

Counting items, setting stock levels, capacity planning, or any discrete numeric quantities

Measurements & Metrics

Recording dimensions, weights, distances, performance metrics, or scientific measurements

Scoring & Calculations

Custom scoring systems, weighted calculations, or complex numeric evaluations beyond simple ratings

Configuration Options

Number responses support extensive validation and formatting options:

Required Parameters

max_value
number
required
Maximum allowed value (inclusive)

Optional Parameters

min_value
number
default:"0"
Minimum allowed value (inclusive, can be negative)
decimal_places
integer
default:"2"
Number of decimal places allowed (0-10)
prefix
string
Text to display before the number (e.g., ”$”, ”€”, ”#”)
suffix
string
Text to display after the number (e.g., ” USD”, ” kg”, ” items”)
allow_negative
boolean
default:"false"
Whether negative numbers are permitted
required
boolean
default:"false"
Whether a numeric value is mandatory for completion

Implementation Examples

Product Pricing

Currency-formatted price input with validation:
request_data = {
    "processing_type": "deferred",
    "type": "markdown",
    "priority": "medium",
    "request_text": "Please set the pricing for this new product based on the market analysis:\n\n**Product:** Premium Wireless Headphones\n**Cost to Manufacture:** $45.00\n**Market Research:**\n- Competitor A: $89.99\n- Competitor B: $129.99 \n- Competitor C: $79.99\n**Target Margin:** 40-60%\n**Recommended Price Range:** $75-$150\n\nConsider positioning, target market, and competitive landscape when setting the final price.",
    "response_type": "number",
    "response_config": {
        "min_value": 50.00,
        "max_value": 200.00,
        "decimal_places": 2,
        "prefix": "$",
        "suffix": " USD",
        "allow_negative": False,
        "required": True
    },
    "default_response": 89.99,  # Conservative competitive pricing
    "timeout_seconds": 259200,  # 3 days
    "platform": "api"
}

Inventory Quantity Assessment

Whole number inventory count with no decimals:
# Inventory count verification
request_data = {
    "processing_type": "time-sensitive",
    "type": "image",
    "image_url": "https://storage.company.com/warehouse/shelf-section-A7.jpg",
    "priority": "high",
    "request_text": "Count the number of 'Premium Coffee Blend' packages visible on this warehouse shelf section. This is for our quarterly inventory audit.\n\n**Product Details:**\n- SKU: PCB-001\n- Package Type: 12oz bags\n- Expected Range: 45-85 units\n- Location: Section A7, Shelf 3\n\nPlease provide an accurate count of visible packages.",
    "response_type": "number",
    "response_config": {
        "min_value": 0,
        "max_value": 200,
        "decimal_places": 0,  # Whole numbers only
        "prefix": "",
        "suffix": " units",
        "allow_negative": False,
        "required": True
    },
    "default_response": 0,  # Conservative default for inventory
    "timeout_seconds": 3600,  # 1 hour
    "platform": "api"
}

Scientific Measurement

High-precision measurement with decimals:
# Laboratory measurement verification
request_data = {
    "processing_type": "time-sensitive",
    "type": "markdown",
    "priority": "high",
    "request_text": "Verify the pH measurement reading from this laboratory test:\n\n**Sample:** Water Quality Test #WQ-2024-0847\n**Test Method:** Calibrated pH meter\n**Expected Range:** 6.5 - 8.5 (EPA drinking water standards)\n**Digital Reading:** 7.23\n**Lab Conditions:** 22°C, calibrated this morning\n\n**Quality Control:**\nPlease confirm the pH reading is accurate based on the sample color indicators and equipment calibration status shown in the attached documentation.\n\nNote: This is for regulatory compliance reporting.",
    "response_type": "number",
    "response_config": {
        "min_value": 0.0,
        "max_value": 14.0,
        "decimal_places": 2,
        "prefix": "pH ",
        "suffix": "",
        "allow_negative": False,
        "required": True
    },
    "default_response": 7.0,  # Neutral pH default
    "timeout_seconds": 7200,  # 2 hours
    "platform": "api"
}

Budget Allocation

Financial planning with negative values allowed:
# Budget adjustment request
request_data = {
    "processing_type": "deferred",
    "type": "markdown",
    "priority": "medium", 
    "request_text": "Review the Q4 marketing budget variance and recommend adjustment:\n\n**Original Budget:** $50,000\n**Current Spend:** $42,500 (85% utilized)\n**Remaining Period:** 6 weeks\n**Performance:**\n- Lead generation: 120% of target\n- Conversion rate: 15% above average\n- Cost per acquisition: 12% below target\n\n**Options:**\n- Increase budget for additional campaigns (+)\n- Return unused budget to company (-)\n- Maintain current allocation (0)\n\nRecommend budget adjustment amount (positive = increase, negative = decrease, 0 = no change).",
    "response_type": "number",
    "response_config": {
        "min_value": -25000.00,
        "max_value": 25000.00,
        "decimal_places": 2,
        "prefix": "$",
        "suffix": " USD",
        "allow_negative": True,
        "required": True
    },
    "default_response": 0.00,  # No change default
    "timeout_seconds": 604800,  # 7 days
    "platform": "api"
}

Response Format

When a reviewer enters a number, you’ll receive both the raw value and formatted display:
{
  "response_data": {
    "number": 129.99,
    "formatted_value": "$129.99 USD"
  }
}

Use Case Examples

1. Product Pricing Decision

pricing_config = {
    "response_type": "number",
    "response_config": {
        "min_value": 10.00,
        "max_value": 500.00,
        "decimal_places": 2,
        "prefix": "$",
        "suffix": " USD",
        "allow_negative": False,
        "required": True
    }
}

2. Inventory Management

inventory_config = {
    "response_type": "number",
    "response_config": {
        "min_value": 0,
        "max_value": 10000,
        "decimal_places": 0,
        "prefix": "",
        "suffix": " units",
        "allow_negative": False,
        "required": True
    }
}

3. Performance Metrics

performance_config = {
    "response_type": "number",
    "response_config": {
        "min_value": 0.0,
        "max_value": 100.0,
        "decimal_places": 1,
        "prefix": "",
        "suffix": "%",
        "allow_negative": False,
        "required": True
    }
}

Validation and Error Handling

Automatic Validation

The mobile app automatically validates number responses:
  • Type validation: Ensures input is a valid numeric value
  • Range validation: Checks value falls within min_value and max_value bounds
  • Decimal precision: Enforces decimal_places limit
  • Required validation: Prevents submission when required=true and no value provided
  • Negative number handling: Blocks negative values when allow_negative=false

Server-Side Validation

Your application should validate received numbers:
def validate_number_response(response_data, response_config):
    """Validate number response against configuration"""
    
    if not isinstance(response_data, dict):
        return False, "Response must be an object"
    
    if "number" not in response_data:
        return False, "Missing number field"
    
    number = response_data["number"]
    
    # Validate numeric type
    if not isinstance(number, (int, float)):
        return False, "Value must be a number"
    
    # Check range bounds
    min_value = response_config.get("min_value", 0)
    max_value = response_config["max_value"]
    
    if number < min_value:
        return False, f"Value must be at least {min_value}"
    
    if number > max_value:
        return False, f"Value cannot exceed {max_value}"
    
    # Check negative values
    allow_negative = response_config.get("allow_negative", False)
    if not allow_negative and number < 0:
        return False, "Negative values are not allowed"
    
    # Check decimal places
    decimal_places = response_config.get("decimal_places", 2)
    if decimal_places == 0 and number != int(number):
        return False, "Decimal values are not allowed"
    
    # Validate decimal precision
    decimal_str = str(number).split('.')[1] if '.' in str(number) else ""
    if len(decimal_str) > decimal_places:
        return False, f"Maximum {decimal_places} decimal places allowed"
    
    # Check required
    if response_config.get("required", False) and number is None:
        return False, "Number is required"
    
    return True, "Valid"

# Usage example
is_valid, error_message = validate_number_response(
    response_data={
        "number": 149.99,
        "formatted_value": "$149.99 USD"
    },
    response_config={
        "min_value": 50.00,
        "max_value": 500.00,
        "decimal_places": 2,
        "allow_negative": False,
        "required": True
    }
)

Best Practices

Configuration Design

Processing Best Practices

Common Patterns

Dynamic Range Validation

# Adjust validation ranges based on context
def get_dynamic_price_range(product_category, market_tier):
    """Calculate appropriate price ranges based on product context"""
    
    base_ranges = {
        "electronics": {"budget": (20, 200), "premium": (200, 2000)},
        "clothing": {"budget": (10, 100), "premium": (100, 500)},
        "home": {"budget": (25, 250), "premium": (250, 1000)}
    }
    
    if product_category in base_ranges:
        min_val, max_val = base_ranges[product_category][market_tier]
        return {
            "min_value": min_val,
            "max_value": max_val,
            "decimal_places": 2,
            "prefix": "$",
            "suffix": " USD"
        }
    
    # Default fallback
    return {
        "min_value": 1.00,
        "max_value": 1000.00,
        "decimal_places": 2,
        "prefix": "$",
        "suffix": " USD"
    }

Multi-Currency Support

# Handle different currencies based on user location
def get_currency_config(user_location):
    """Generate number config for appropriate currency"""
    
    currency_configs = {
        "US": {"prefix": "$", "suffix": " USD", "decimal_places": 2},
        "EU": {"prefix": "€", "suffix": " EUR", "decimal_places": 2},
        "UK": {"prefix": "£", "suffix": " GBP", "decimal_places": 2},
        "JP": {"prefix": "¥", "suffix": " JPY", "decimal_places": 0}
    }
    
    return currency_configs.get(user_location, currency_configs["US"])

Aggregate Calculations

# Process multiple number responses together
def calculate_weighted_average(number_responses, weights=None):
    """Calculate weighted average from multiple number responses"""
    
    if not number_responses:
        return None
    
    numbers = [response["number"] for response in number_responses]
    
    if weights and len(weights) == len(numbers):
        weighted_sum = sum(n * w for n, w in zip(numbers, weights))
        total_weight = sum(weights)
        return weighted_sum / total_weight if total_weight > 0 else None
    else:
        # Simple average if no weights provided
        return sum(numbers) / len(numbers)

Next Steps