When you write a Notion formula that joins a number with text using the concat() function or the + operator, the output often displays the number as a text string instead of a numeric value. This happens because Notion automatically converts numbers to text when they are combined with strings in a formula. The result may look correct visually but cannot be used in further numeric calculations or database rollups that expect a number. This article explains why Notion formula concatenation forces numbers into text and provides the exact steps to keep numeric values intact when you need them for calculations.
Key Takeaways: Preventing Number to Text Conversion in Notion Formula Concatenation
- concat() function: Always returns a text string; any number passed to it becomes text automatically.
- + operator with text: When one operand is text, Notion treats the + as concatenation and converts numbers to strings.
- format() function: Use format(number) to explicitly convert a number to text only when you intend to display it in a text context.
- toNumber() function: Use toNumber(text) to convert concatenated text back to a number for further numeric operations.
Why Notion Converts Numbers to Text in Concatenation
Notion formulas use a type system where each value has a specific data type: text, number, boolean, date, or array. When you use the concat() function, its definition requires all arguments to be text. Notion automatically calls the format() function on any non-text value passed to concat(), converting numbers and other types to their string representation. The same automatic conversion happens when you use the + operator with at least one text operand. Notion interprets + as numeric addition only when both operands are numbers. If one operand is text, Notion treats + as concatenation and converts the other operand to text as well.
This behavior is not a bug. It is a deliberate design choice to prevent type errors. However, it can be confusing because the formula output looks like a number but behaves like text. You cannot use the result in a rollup that sums values or in another formula that expects a number. The output cell in a database property will show the value left-aligned, which is the default for text in Notion, while numbers appear right-aligned.
How the Type Conversion Happens
Consider this formula: concat(“Order “, 42). Notion evaluates the number 42 and calls format(42) internally, producing the text “42”. The final output is the text string “Order 42”. Similarly, “Total: ” + 100 produces the text “Total: 100”. The number 100 is converted to text before concatenation. If you later try to use the result in a formula that expects a number, such as sum(prop(“Order Total”)), Notion will throw a type error because the property contains text, not a number.
Steps to Control Number to Text Conversion in Concatenation
To prevent unwanted conversion or to restore numeric behavior after concatenation, use the following methods.
Method 1: Keep Numbers Separate from Text
If you need the numeric value for calculations, do not concatenate it with text in the same formula property. Instead, create two separate formula properties: one that returns the number and another that returns the text display.
- Create a numeric formula property
Add a new formula property named “Numeric Value”. Write a formula that returns the number without any text. Example: prop(“Price”) 1.15. This property will remain a number type and can be used in rollups and other numeric formulas. - Create a display formula property
Add another formula property named “Display Value”. Write a formula that concatenates the number with text. Example: concat(“Total: “, format(prop(“Numeric Value”))). This property returns text and is safe for display only. - Use the numeric property in calculations
In rollups or other formulas that need the number, reference the “Numeric Value” property. Do not reference the “Display Value” property for math operations.
Method 2: Convert Concatenated Text Back to Number
If you have already created a formula that outputs text and you need to use the numeric part in further calculations, use the toNumber() function to extract the number.
- Identify the text formula property
Locate the formula property that returns concatenated text containing a number. Example: prop(“Order Info”) returns “Order 42”. - Extract the number with toNumber() and slice()
In a new formula property, write a formula that isolates the numeric portion and converts it. Example: toNumber(slice(prop(“Order Info”), 6)). This assumes the number starts after the first 6 characters. Adjust the slice start index based on your text structure. - Use the extracted number
The new formula property returns a number type. You can now use it in rollups and other numeric formulas.
Method 3: Use format() Explicitly When You Want Text
When your intention is to display a number as text, use the format() function explicitly. This makes the conversion clear and avoids accidental type confusion.
- Write the formula with format()
Example: concat(“Revenue: $”, format(prop(“Revenue”))). This explicitly converts the Revenue number to text before concatenation. - Verify the output type
Check that the property returns text. You can confirm this by trying to use the property in a numeric formula. If Notion shows a type error, the property is text. - Document the conversion
Add a note in the formula description field so other workspace members know the property is for display only.
Common Mistakes and Limitations with Concatenated Numbers
Using concat() with Numbers Without format()
You do not need to call format() manually inside concat() because Notion does it automatically. However, relying on implicit conversion can make your formula harder to read. Always use format() for clarity. If you forget and the number is the only argument, concat(42) returns the text “42”, not the number 42.
+ Operator with Text and Number
If you write “Value: ” + 10, the result is text. If you write 10 + “Value: “, the result is also text. The order does not matter. To force numeric addition, ensure both operands are numbers. If one operand might be text, wrap it with toNumber(). Example: toNumber(prop(“String Number”)) + 5.
Rollup Fails on Concatenated Output
A rollup property that sums values from related database rows will ignore any property that returns text. If you concatenate a number with text in a formula property and then try to sum that property in a rollup, the rollup will show 0 or an error. To fix this, create a separate numeric formula property as described in Method 1.
Sorting Behavior Changes
Text values sort alphabetically, not numerically. A property that returns “10” as text will sort before “2” because “1” comes before “2” in character order. If you need correct numeric sorting, keep the property as a number type.
Notion Formula Output Types: Text vs Number Comparison
| Item | Text Output | Number Output |
|---|---|---|
| Alignment in database | Left-aligned | Right-aligned |
| Rollup sum support | Not supported; returns 0 | Supported |
| Sorting behavior | Alphabetical | Numerical |
| Formula functions that can use it | concat(), format(), slice(), replace() | add(), subtract(), multiply(), divide(), pow(), round(), toNumber() |
| Created by | concat(), format(), + with a text operand | Direct number, arithmetic operators, toNumber() on text |
Understanding these differences helps you decide whether to keep a number as a number or convert it to text for display. Use the methods in this article to control the conversion and avoid broken rollups or incorrect sorting.