// ==UserScript== // @name BMI and converter // @namespace Stanscript // @description Calculates BMI, Converts to lbs, ins. // @include *oscarEncounter/oscarMeasurements/SetupMeasurements.do?groupName=BMI* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js // @grant none // ==/UserScript== function ButtonFunction1(){ vWT = $("input[name='value(inputValue-2)']").val(); if(vWT){ vWTlb = (Number(vWT)*2.2).toFixed(1) $("input[name='value(comments-2)']").val(" ("+vWTlb+ " lbs)");} vHT = $("input[name='value(inputValue-1)']").val(); if(vHT){ vHTin = (Number(vHT)/2.54).toFixed(1) $("input[name='value(comments-1)']").val(" ("+vHTin+" inches"+" or "+(vHTin/12).toFixed(1)+ " feet)") vBMI = vWT/(vHT*.01*vHT*.01)} if(vBMI){ $("input[name='value(inputValue-0)']").val(vBMI.toFixed(1));} } $("input[name='value(inputValue-1)']").change(ButtonFunction1) $("input[name='value(inputValue-2)']").change(ButtonFunction1)