The unaryPlus (+
) operator is used to convert Booleans and numeric strings to numbers.
+string
+Boolean
unaryPlus(string)
unaryPlus(Boolean)
Unlike toNumber, it cannot convert dates to numbers. Otherwise, it is functionally equivalent, and it can be written with the +
operator for quick use.
You can also use the function version, unaryPlus()
.
Good to know: A unary operator only has a single operand, while a binary operator has two. unaryPlus and unaryMinus are, as their names imply, unary operators. Examples of binary operators include add, divide, pow, etc.
Example Formulas
+"42" // Output: 42
+true // Output: 1
+false // Output: 0
unaryPlus("42") // Output: 42
unaryPlus()
can be combined with other operators, including unaryMinus and even add, which uses the same +
character.
20 + + "30" // Output: 50
-+"30" // Output: -30
20 + - + "30" // Output? -10 [Notion will rewrite this to 20 + -(+"30")]
Using unaryPlus()
on a string value that contains any non-numeric characters will result in null output. However, that “null” output is still considered to be a number in terms of its data type.
This can cause formulas that contain additional functions or output to throw a Type Mismatch error.
Oddly, +""
returns 0
rather than null
. This is contrary to the equivalent toNumber formula: toNumber("")
returns null
.
+"Monkey" // Output: null (but still Number type)
+"42 Monkeys" // Output: null (but still Number type)
+"" // Output: 0
+"Monkeys" + 22 // Output: 22
+"Monkeys" + " and rabbits loop the loop" // Output: Type Mismatch Error
Example Database: Daily Habit Score
The example database below tracks daily habits with a checkbox property for each habit. The Score property converts each checkbox’s Boolean value into a number, and then adds up a total score for the day.

View and Duplicate Database

“Score” Property Formula
+prop("Deck Swabbed") + +prop("Teeth Brushed") + +prop("Lime Eaten")
Other formula components used in this example:

Example Database: Numeric Phone Numbers
Notion’s Phone Number property type outputs a string (see it listed in the API Reference for more detail).
The example database below uses unaryPlus and the replaceAll function to turn phone numbers into true numbers, even if they have additional formatting.

View and Duplicate Database

“Number” Property Formula
+replaceAll(prop("Phone"), "[() -]", "")
unaryPlus can’t operate on a string that contains non-numeric characters such as (
or -
. So Number first uses the replaceAll function to remove them. It does this by passing a regular expression in its matching argument – "[() -]"
– where the special bracket []
characters equate to:
“Match any character listed here.”
This includes the space
.
Next, replaceAll()
‘s replacement argument replaces all matched characters with an empty string – ""
– in effect removing them. The result is a phone number converted to a purely numeric string – e.g. (482) 491-5813
is converted to 4824915813
.
Finally, the +
operator converts this numeric string into a true number.
Other formula components used in this example:
