to-number-x

WebJar for to-number-x

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

to-number-x
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

to-number-x
WebJar for to-number-x
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Xotic750/to-number-x

Download to-number-x

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/to-number-x/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>to-number-x</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/to-number-x/
implementation 'org.webjars.npm:to-number-x:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/to-number-x/
implementation ("org.webjars.npm:to-number-x:2.0.0")
'org.webjars.npm:to-number-x:jar:2.0.0'
<dependency org="org.webjars.npm" name="to-number-x" rev="2.0.0">
  <artifact name="to-number-x" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='to-number-x', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "to-number-x" % "2.0.0"
[org.webjars.npm/to-number-x "2.0.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.npm : parse-int-x jar [2.0.0,3)
org.webjars.npm : to-primitive-x jar [1.1.0,2)
org.webjars.npm : trim-x jar [3.0.0,4)
org.webjars.npm : nan-x jar [1.0.0,2)
org.webjars.npm : cached-constructors-x jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

to-number-x

Converts argument to a value of type Number.

module.exports(value)*

to-number-x*

This method converts argument to a value of type Number. (ES2019)

Kind: static property of to-number-x
Returns: * - The argument converted to a number.
Throws:

  • TypeError - If argument is a Symbol or not coercible.
Param Type Description
argument * The argument to convert to a number.

Example

import toNumber from 'to-number-x';

console.log(toNumber('1')); // 1
console.log(toNumber(null)); // 0
console.log(toNumber(true)); // 1
console.log(toNumber('0o10')); // 8
console.log(toNumber('0b10')); // 2
console.log(toNumber('0xF')); // 16

console.log(toNumber(' 1 ')); // 1

console.log(toNumber(Symbol(''))); // TypeError
console.log(toNumber(Object.create(null))); // TypeError

Versions

Version
2.0.0