LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices



Old
Rating: 2 votes, 4.50 average.

Convert Metric <-> Imperial

Posted 01-03-2014 at 05:14 AM by druuna
Updated 01-31-2014 at 04:24 AM by druuna

Converting from metric to imperial and vice versa using bc.

Here are a few examples in the form of functions:

# -------------------------------------------------------------------------- #
# - Imperial to metric
# -------------------------------------------------------------------------- #

  • pounds to kilograms
PHP Code:
# Function : lbToKg
# Syntax   : lbToKg <pounds>
#
# Convert pounds to kilogram
function lbToKg() { 
...
LQ Veteran
Posted in General
Views 853 Comments 0 druuna is offline

  



All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration