Request Dev Services Ā»

theDevTip.com

Handy JS snippets – Convert lbs to Kg

One quick and handy JavaScript snippet for your soul… Convert and display lb weigh units to KilogramsĀ with just a few tiny lines of code.

function convert() {
   var lb = $("#pValue").val(); // get value
   var kg = Math.round(lb / 2.2); // do math
   $("#kValue").html(kg); // output
}

About the Author
Cameron Cashwell Web Developer
I build websites, web apps, and software. Wanna work together? Let's chat about your project!

Leave a Reply

avatar
  Subscribe  
Notify of