> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/code/builtin/data-transformation-functions/booleans.md).

# Boolean transformation methods in Duaer

In a Duaer expression, a boolean can be tested for empty and converted to a number or a string. true becomes 1 as a number; false becomes 0.
## Methods

- isEmpty() returns true for false, null, or undefined, and false for true. It is not only a missing-field check.
- isNotEmpty() is the inverse of isEmpty().
- toNumber() turns true into 1 and false into 0.
- toString() turns the boolean into the string true or false.

```
{{ $json.active.toNumber() }}
```
## Questions

### What does toNumber return in a Duaer expression?

In a Duaer expression, true becomes 1 and false becomes 0. toString() becomes the string true or false.

### Does Duaer isEmpty treat false as empty?

Yes. In a Duaer expression, isEmpty() on a boolean returns true for false, null, or undefined, and false for true. It is not only a missing-field check.

## Related

- [Use data transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions.md)
- [Number transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions/numbers.md)
- [String transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions/strings.md)

