Bonsai Coder
Active member
I am trying to write custom BBcode for my site that allows a user to enter a temperature and have it display in both C and F. For example:
[temp=C]0[/temp]
0 C / 32 F
I am using this code:
Simple replacement, no option parameter.
I can't seem to get it to work(?)
[temp=C]0[/temp]
0 C / 32 F
I am using this code:
Rich (BB code):
<script type="text/javascript">if( ("{SIMPLETEXT}".substring(0,1)=="C")||("{SIMPLETEXT}".substring(0,1)=="c")){document.write("{TEXT}° C / " +(({TEXT}*1.8) +32).toFixed(2) +"° F " );}else {document.write("" + (({TEXT}-32)/1.8).toFixed(2) + "° C / {TEXT}° F");}</script>
Simple replacement, no option parameter.
I can't seem to get it to work(?)
Last edited: