Advertisement
Nyan-Cat

OM Fixer for Firefox

Jul 2nd, 2020
1,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         OM Fixer for Firefox
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  FIxes the FB per second calculation on Firefox browsers
  6. // @author       Nyan Cat
  7. // @match        http*://patcailmemer.github.io/Ordinal-Markup/
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.   'use strict';
  13.   window.OPtoOrd = function OPtoOrd(x, b, trim = 0) {
  14.     if (x <= 0.000000000001 || trim >= 12) return 0; // Change == 0 to extremely close to 0
  15.     let exp = Math.floor(Math.log10(x) + 0.000000000001);
  16.     if (validInBase(exp, b)) {
  17.       let coef = Math.floor(x / 10 ** exp + 0.000000000001);
  18.       if (coef >= b) return b ** (OPtoOrd(exp, b, trim + 1) + 1);
  19.       return b ** OPtoOrd(exp, b, trim + 1) * coef + OPtoOrd(x - coef * 10 ** exp, b, trim + 1);
  20.     } else {
  21.       return b ** OPtoOrd(exp, b, trim + 1);
  22.     }
  23.   }
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement