-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init code style guide * init big number util file
- Loading branch information
Showing
5 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Maker Style Guide | ||
|
||
### Components | ||
|
||
### State | ||
|
||
### JS Hygiene | ||
|
||
[Clean Code](https://github.com/ryanmcdermott/clean-code-javascript) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import BigNumber from 'bignumber.js'; | ||
|
||
export function greaterThan(numberOne, numberTwo) { | ||
return ( | ||
BigNumber(numberOne.toString()).comparedTo( | ||
BigNumber(numberTwo.toString()) | ||
) === 1 | ||
); | ||
} | ||
|
||
export function greaterThanOrEqual(numberOne, numberTwo) { | ||
return ( | ||
BigNumber(numberOne.toString()).comparedTo( | ||
BigNumber(numberTwo.toString()) | ||
) >= 0 | ||
); | ||
} | ||
|
||
export function multiply(numberOne, numberTwo) { | ||
return BigNumber(numberOne.toString()) | ||
.times(BigNumber(numberTwo.toString())) | ||
.toString(); | ||
} | ||
|
||
export function divide(numberOne, numberTwo) { | ||
return BigNumber(numberOne.toString()) | ||
.dividedBy(BigNumber(numberTwo.toString())) | ||
.toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters