5


I want this:

In website have var number = 0.33 and I want var second = fractions of variable 'number', and if "number" fractions change : second will change.

But how?

Radi Cho
  • 680
  • 7
  • 21

1 Answers1

5

You can use Erik Garrison's fraction.js library to do that and more fractional operations.

var second = new Fraction(.033);
console.log(second.numerator + '/' + second.denominator);
Akhilesh Singh
  • 1,724
  • 2
  • 19
  • 35