156
rated 0 times
[
158]
[
2]
/ answers: 1 / hits: 19249
/ 12 Years ago, wed, december 5, 2012, 12:00:00
I'm making a BMI calculator (see JSFiddle - http://jsfiddle.net/b5ww2/) and I want the height in inches to display in feet and inches. I also want the weight in pounds to be displayed in stones and pounds.
This is the code I'm using to convert the slider value to cm and inches:
slide: function( event, ui ) {
$( #heightslidecm ).html( ui.value + 'cm' );
$( #heightslidein ).html( (ui.value*0.393700787).toFixed(0) + 'in' );
}
My js knowledge isn't great - especially when it comes to the math aspect.
Any ideas?
Thanks in advance
More From » jquery