The `log10()`

function returns the base-10 logarithm of a number.

`log10(number)`

For reference, here are the named components of a logarithm:

\(\log_{base} argument = exponent\)A **logarithm** is the exponent of the base that returns the argument.

## Example Formulas

```
log10(1000) // Output: 3
log10(10) // Output: 1
```

Want to learn more about logarithms? Check out this resource:

### Computing Logs with Other Bases (Log Base X)

Notion only provides `log10()`

, log2, and ln because those are by far the most commonly-used log bases.

However, if you need to compute a log with a different base, you can use the change of base formula:

\(\log_x y= (\frac{\ln y}{\ln x})\)So, for example:

\(\log_3 81 = (\frac{\ln 81}{\ln 3})\)Here’s a Notion formula to compute this:

```
ln(81) / ln(3) // Output: 4
```

## Example Database

\(log_{10}\) can be used to perform an interesting mathematical trick – finding the length (i.e. number of digits) in any number. It is done by taking the **floor value** of a number’s \(log_{10}\), then adding one:

The example database below shows this trick in action.

### View and Duplicate Database

### “Length” Property Formula

```
// Compressed
floor(log10(prop("Num"))) + 1
// Expanded
floor(
log10(
prop("Num")
)
) + 1
```

If you’re curious about the math behind why this trick works, check out this thread:

The formula itself is quite simple:

- We pass
`prop("Num")`

to the`log10()`

function. - This value is then run through the floor function in order to round it to its nearest integer of lower or equal value.
- Finally, we add
`1`

.