Skip to main content
The Number field only accepts number entries (integers and decimals) and returns a JSON number in the API, which makes it perfect for prices, quantities, and dimensions. Number field configuration in ButterCMS
Always use the Number field for numeric data instead of Short Text. This ensures proper type validation and returns the correct data type in your API response.

Field at a glance

Input and output

Input type

Numbers (integers, decimals, and floats)

API output

number

API response example

Field configuration options

Use help text and default values to guide your content teams.

Common use cases

E-commerce
  • Product prices
  • Stock quantities
  • Shipping weights
  • Discount percentages
  • Order totals
Events and scheduling
  • Event capacity
  • Number of attendees
  • Duration in minutes/hours
  • Room numbers
Content metrics
  • Read time estimates
  • View counts
  • Rating scores
  • Sort order/priority
Configuration values
  • Display order
  • Maximum items to show
  • Pagination limits

Handling different number types

Integers

Number fields support integers (numbers without a decimal), including both zero and negative integers.

Decimals (floats)

Number fields support decimal/float values with no restriction on the number of places after the decimal. This includes both 0.00 and negative numbers.

Large numbers

Be aware of JavaScript’s number precision limits for very large numbers:

Number field vs. Short Text for numbers

Always use the Number field for numeric data instead of Short Text. This ensures proper type validation and returns the correct data type in your API response.

Best practices

Prices

  • Consider your currency’s decimal precision
  • Use help text to specify the expected currency

Quantities

  • Use integers only (no decimals)
  • Use help text to clarify expected values

Percentages

  • Clarify in help text whether to enter as 15 or 0.15 for 15%

Ratings

  • Consider using a dropdown for consistent values

Working with numbers in your application

JavaScript example

Python example