UNPKG
theorem.js
Version:
latest (1.2.0)
1.2.0
1.1.0
1.0.1
1.0.0
0.1.0
0.0.2
0.0.1
A Math library for computation in JavaScript
github.com/arguiot/TheoremJS
arguiot/TheoremJS
theorem.js
/
src
/
includes
/
functions
/
math
/
fractions
/
toDec.js
14 lines
(13 loc)
•
292 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
toDec() {
const
args
= [...arguments]
if
(
typeof
args
[
0
] ==
'object'
) {
if
(
args
[
0
].length !=
2
) {
throw
"Require 2 numbers"
}
return
new
BigNumber(
args
[
0
][
0
]).div(
args
[
0
][
1
]) }
if
(
args
.length !=
2
) {
throw
"Require 2 numbers"
}
return
new
BigNumber(
args
[
0
]).div(
args
[
1
]) }