> 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/numbers.md).

# Number transformation methods in Duaer

In a Duaer expression, number methods round, test even or odd, and convert to a boolean, a string, or a DateTime. round goes to the nearest number; ceil goes up; floor goes down.
## Methods

- abs() is the absolute value.
- ceil() rounds up. floor() rounds down. round(decimalPlaces) rounds to the nearest number.
- isEven(), isOdd(), and isInteger() test even, odd, and integer.
- isEmpty() and isNotEmpty() test emptiness.
- format(pattern) writes a string in that pattern. toLocaleString() uses the current locale. toString() is a plain string.
- toBoolean() is false for 0 and true for any other number.
- toDateTime() treats the number as a timestamp and returns a DateTime. Match milliseconds or seconds to how you stored it, then format with the date methods.

```
{{ $json.amount.round(2) }}
```
## Questions

### How do round, ceil, and floor differ in Duaer?

In a Duaer expression, round() goes to the nearest number and can take a decimal-place count. ceil() rounds up. floor() rounds down. abs() is the absolute value.

### How does toBoolean treat a number in Duaer?

In a Duaer expression, 0 becomes false; any other number becomes true.

## Related

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

