Ultimate Temperature BBCode
This BBcode is so simple to use...
You enter a temperature in celsius, fahrenheit, kelvin, or rankine. And it will convert it to all 4 of thoose measurements. Exmaple If you entered 100.1234 for celsius this would be the final result: [temp=c]100.1234[/temp] displays: 100.1234ºC (212.22212ºF / 373.2734K / 671.89212ºRa) [temp=c]###[/temp] ~ Celsius [temp=f]###[/temp] ~ Fahrenheit [temp=k]###[/temp] ~ Kelvin [temp=r]###[/temp] ~ Rankine Here is the code: Admin CP > BBCode > New: Title: Code:
Temperature Conversion Code:
temp Code:
<script language="Javascript"> <!-- var option1 = "{option}"; if (option1 == "c" || option1 == "C") { text1a = "{param}ºC ("; var num2a = ((Math.round((({param}*1.8+32.00)*100)))/100); text2a = num2a.toString(); text3a = "ºF / "; var num4a = ((Math.round((({param}+273.15)*100)))/100); text4a = num4a.toString(); text5a = "K / "; var num6a = ((Math.round((({param}*1.8+491.67)*100)))/100); text6a = num6a.toString(); text7a = "ºRa)"; document.write(text1a); document.write(text2a); document.write(text3a); document.write(text4a); document.write(text5a); document.write(text6a); document.write(text7a); } else if (option1 == "f" || option1 == "F") { text1b = "{param}ºF ("; var num2b = ((Math.round(((({param}-32.00)*(5/9))*100)))/100); text2b = num2b.toString(); text3b = "ºC / "; var num4b = ((Math.round((((({param}-32.00)*(5/9))+273.15)*100)))/100); text4b = num4b.toString(); text5b = "K / "; var num6b = ((Math.round((((({param}-32.00)*(5/9))*1.8+491.67)*100)))/100); text6b = num6b.toString(); text7b = "ºRa)"; document.write(text1b); document.write(text2b); document.write(text3b); document.write(text4b); document.write(text5b); document.write(text6b); document.write(text7b); } else if (option1 == "k" || option1 == "K") { text1c = "{param}K ("; var num2c = ((Math.round(((({param}-273.15)*1.8+491.67)*100)))/100); text2c = num2c.toString(); text3c = "ºRa / "; var num4c = ((Math.round((({param}-273.15)*100)))/100); text4c = num4c.toString(); text5c = "ºC / "; var num6c = ((Math.round(((({param}-273.15)*1.8+32.00)*100)))/100); text6c = num6c.toString(); text7c = "ºF)"; document.write(text1c); document.write(text2c); document.write(text3c); document.write(text4c); document.write(text5c); document.write(text6c); document.write(text7c); } else if (option1 == "r" || option1 == "R" || option1 == "Ra" || option1 == "ra" || option1 == "RA" || option1 == "rA") { text1d = "{param}ºRa ("; var num2d = ((Math.round((((({param}-491.67)*(5/9))+273.15)*100)))/100); text2d = num2d.toString(); text3d = "K / "; var num4d = ((Math.round(((({param}-491.67)*(5/9))*100)))/100); text4d = num4d.toString(); text5d = "ºC / "; var num6d = ((Math.round((((({param}-491.67)*(5/9))*1.8+32.00)*100)))/100); text6d = num6d.toString(); text7d = "ºF)"; document.write(text1d); document.write(text2d); document.write(text3d); document.write(text4d); document.write(text5d); document.write(text6d); document.write(text7d); } //--> </script> Code:
[temp=c]100[/temp] Code:
Converts a given temperature in Celsius, Fahrenheit, Kelvin, and/or Rankine to the other units of measurement. Example (Celsius): The final outcome is formatted as: aºC (bºF / cK / dºRa) so, [temp=c]100.1234[/temp] displays: 100.1234ºC (212.22212ºF / 373.2734K / 671.89212ºRa) Code:
Yes. Download No files for download. |
Similar Mods
BB Code Enhancements Blink BBCode- The Ultimate BB Code! | vBulletin 4.x Add-ons |
BB Code Enhancements Blink BBCode- The Ultimate BB Code! | vBulletin 3.8 Add-ons |