Created
December 13, 2023 12:19
-
-
Save jsilva74/407fbb8319980c0ee904f3ad28de74fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name Total w/o fuel | |
// @namespace http://tampermonkey.net/ | |
// @version 2023-12-13 | |
// @description try to take over the world! | |
// @author José Silva Jr. | |
// @match https://server.fseconomy.net/myflight.jsp | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=fseconomy.net | |
// @grant none | |
// ==/UserScript== | |
/* global $ */ | |
$(document).ready(function() { | |
const table = $('.myflight-assignments table:eq(2)') | |
const row = $(table).find('tbody tr:eq(1)') | |
const fuel = $(row).find('td:eq(2)').text() | |
const total = $(row).find('td:eq(7)').text() | |
const payloWithoutFuel = Number(total.replace(/[^0-9]/g, '')) - Number(fuel.replace(/[^0-9]/g, '')) | |
const payloadInPounds = Math.round(payloWithoutFuel * 2.20462) | |
$(row).find('td:eq(7)').text(`${total} (${Intl.NumberFormat('en-US').format(payloWithoutFuel)}Kg / ${Intl.NumberFormat('en-US').format(payloadInPounds)}Lb)`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment