README
JavaScript Math Library
This is a lightweight JavaScript library that extends the functionality of the number object.
Getting Started
Run the following command in your project folder:
npm install @annapawl/math_library --save
Then add this to your index.js file
require('@annapawl/src/math_library')
Golden Ratio
goldenRatio()
This function returns the golden ratio
Number.goldenRatio() → 1.61803398875
Rounding Methods
round()
This method rounds a specified number
'9.99.round() → 10
roundDown()
This method rounds a specified number down
'9.99.roundDown() → 9
roundUp()
This method rounds a specified number up
'9.2.roundUp() → 10
Degrees ↔ Radians
degToRad(n)
This methods converts degrees to radians
45.degToRad()→ 0.785
radToDeg(n)
This methods converts radians to degrees
.785.RadTodeg()→ 44.977
Money Methods
toDollars(amount) This methods takes in a numeric value and returns a string behinning with '