<commit_before># roundn

> Round a numeric value to the nearest multiple of 10^n.


<section class="usage">

## Usage

``` javascript
var roundn = require( '@stdlib/math/base/special/roundn' );
```

#### roundn( x, n )

Rounds a `numeric` value to the nearest multiple of `10^n`.

``` javascript
// Round a value to 2 decimal places:
var v = roundn( Math.PI, -2 );
// returns 3.14

// If n = 0, `roundn` behaves like `round`:
v = roundn( Math.PI, 0 );
// returns 3.0

// Round a value to the nearest thousand:
v = roundn( 12368.0, 3 );
// returns 12000.0
```

</section>

<!-- /.usage -->


<section class="notes">

## Notes

* When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be __inexact__. For example,

    ``` javascript
    var x = 0.2 + 0.1;
    // returns 0.30000000000000004

    // Should round to 0.3...
    var v = roundn( x, -16 );
    // returns 0.3000000000000001
    ```

</section>

<!-- /.notes -->


<section class="examples">

## Examples<commit_msg>Fix indentation of list item<commit_after># roundn

> Round a numeric value to the nearest multiple of 10^n.


<section class="usage">

## Usage

``` javascript
var roundn = require( '@stdlib/math/base/special/roundn' );
```

#### roundn( x, n )

Rounds a `numeric` value to the nearest multiple of `10^n`.

``` javascript
// Round a value to 2 decimal places:
var v = roundn( Math.PI, -2 );
// returns 3.14

// If n = 0, `roundn` behaves like `round`:
v = roundn( Math.PI, 0 );
// returns 3.0

// Round a value to the nearest thousand:
v = roundn( 12368.0, 3 );
// returns 12000.0
```

</section>

<!-- /.usage -->


<section class="notes">

## Notes

* When operating on [floating-point numbers][ieee754] in bases other than `2`, rounding to specified digits can be __inexact__. For example,

  ``` javascript
  var x = 0.2 + 0.1;
  // returns 0.30000000000000004

  // Should round to 0.3...
  var v = roundn( x, -16 );
  // returns 0.3000000000000001
  ```

</section>

<!-- /.notes -->


<section class="examples">

## Examples
{'fraction_non_alphanumeric': 0.16577799321376635, 'fraction_numerical': 0.07077072224915172, 'mean_word_length': 2.9464627151051626, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6645142', 'n_tokens_mistral': 846, 'n_tokens_neox': 695, 'n_words': 245}