mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
40 lines (24 loc) • 586 B
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# Function hex
Format a number as hexadecimal.
## Syntax
```js
math.hex(value)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`value` | number | Value to be stringified
`wordSize` | number | Optional word size (see `format`)
### Returns
Type | Description
---- | -----------
string | The formatted value
## Examples
```js
//the following outputs "0xF0"
math.hex(240)
```
## See also
[oct](oct.md),
[bin](bin.md)