Files
common/docs/util/modules/_hex_tonumber_.md
T
2019-02-26 15:09:10 +00:00

37 lines
684 B
Markdown

# Functions
<a id="hextonumber"></a>
## hexToNumber
▸ **hexToNumber**(value?: *`string` \| `null`*): `number`
*Defined in [hex/toNumber.ts:21](https://github.com/polkadot-js/common/blob/6506c10/packages/util/src/hex/toNumber.ts#L21)*
*__name__*: hexToNumber
*__summary__*: Creates a Number value from a Buffer object.
*__description__*: `null` inputs returns an NaN result, `hex` values return the actual value as a `Number`.
*__example__*:
```javascript
import { hexToNumber } from '@polkadot/util';
hexToNumber('0x1234'); // => 0x1234
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` value | `string` \| `null` |
**Returns:** `number`
___