Convert decimal to rational fraction in JS. Freedom code with open source