# NumericUtil

`NumericUtil` class provides utility methods for numerical operations.

### **Methods**

`round(value: Double, places: Integer): Double`

* Rounds a number to the specified number of decimal places using the default rounding mode (HALF\_UP).

```typescript
var value = 3.14159;
var roundedValue = NumericUtil.round(value, 2);
return roundedValue; // Output: 3.14
```

`roundUp(value: Double, places: Integer): Double`

* Rounds a number up to the specified number of decimal places, always rounding up to the nearest value.

```typescript
var value = 3.14159;
var roundedValue = NumericUtil.roundUp(value, 2);
return roundedValue; // Output: 3.14
```

`roundDown(value: Double, places: Integer): Double`

* Rounds a number down to the specified number of decimal places, always rounding down to the nearest value.

```typescript
var value = 3.14159;
var roundedValue = NumericUtil.roundDown(value, 2);
return roundedValue; // Output: 3.14
```

`parseCustomDouble(value: String, decimalSeparator: String, thousandSeparator: String): Double`

* Parses a string as a double value.

```typescript
var value = "1,000.5"
var customDecimalSeparator = '.';
var customThousandSeparator = ',';

NumericUtil.parseCustomDouble(value, customDecimalSeparator, customThousandSeparator);
```

`formatCustomDouble(value: Double, decimalSeparator: String, thousandSeparator: String): Double`

* Formats a double value as a string.

```typescript
var value = 1000.5
var customDecimalSeparator = '.';
var customThousandSeparator = ',';

NumericUtil.formatCustomDouble(value, customDecimalSeparator, customThousandSeparator);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2winsuite.com/5.6/scripting/utilities/numericutil.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
