abs() : Absolute Value
On this page
Summary
Get the absolute value of a number (remove negative sign).
Signature
abs(value)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value |
Number | Yes | Number to get absolute value of |
Returns
Type: Number (same type as input)
The absolute value of the input number.
Examples
Basic Usage
Calculate Difference
Data:
doc.Params["model"] = new {
actual = 95,
expected = 100
};
Output:
<p>Difference: 5</p>
Show Variance
With Conditional
Notes
- Works with
int,long,double,decimaltypes - Returns same type as input
abs(0)returns0- Useful for calculating distances and differences