Javascript jQuery - Display inches in feet and inches

0 votes

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

Jul 29 in Web Development by gaurav
• 17,580 points
7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

Get Current Date In DD-Mon-YYY Format In ...READ MORE

answered Jun 28 in Web Development by rajatha
• 7,040 points
13 views
0 votes
1 answer

How to display current element in jQuery?

<! DOCTYPE html> <html> <head> <script> $(document). ready(function(){ $("button"). click(function(){ $("p"). text("Welcome to ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
18 views
0 votes
1 answer

What is the difference between JavaScript and jQuery?

JavaScript is an independent language and can ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
26 views
0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

get current date in jquery in dd/mm/yyyy ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
22 views
0 votes
0 answers

JavaScript style.display="none" or jQuery .hide() is more efficient?

document.getElementById("elementId").style.display="none" is used in JavaScript to hide an ...READ MORE

Jun 29 in Web Development by gaurav
• 17,580 points
55 views
0 votes
0 answers

convert base64 to image in javascript/jquery

I have written some code for image ...READ MORE

Jun 29 in Web Development by gaurav
• 17,580 points
129 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,500 points
308 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,740 points
8,826 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,740 points
15,808 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,740 points
1,289 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP