-
-
Notifications
You must be signed in to change notification settings - Fork 30
Fractions
Arthur Guiot edited this page May 20, 2018
·
1 revision
Convert any number n
to a fraction like that:
t.toFraction(1/9) // [ '1', '9' ]
// Set the precision
t.toFraction(3.14159265358, 10) // [ '22', '7' ]
t.toDec(...t.toFraction(1/9)) // ~0.1111111... => BigNumber
Any questions? Don't hesitate to create an issue and tell me about your problem 😊.
Copyright © 2017-2018 Arthur Guiot