Add to Favorites    Make Home Page 7190 Online  
 Language Categories  
 Our Services  

Home » ASP Home » Math Home » StandardToMetric Function

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title StandardToMetric Function
Description The StandardToMetric function converts a US Standard Measure into a Metric
Measure. There are three required arguments: standardmeasure, conversion and
extensiontype.


arguments
============
Standardmeasure
the US Standard measure to convert (This must be a number only)

Conversion
use the table below for values:

conversion argument converts:
--------------------------------------------------------------------------
in-cm inches to centimeters

ft-cm feet to centimeters

in-m inches to meters

yd-m yards to meters

mi-km miles to kilometers

oz-g ounces to grams

lbs-g pounds to grams

oz-kg ounces to kilogram

lbs-kg pounds to kilograms

pt-l pints to liters

qt-l quarts to liters

gal-l gallons to liters

Extensiontype
integer that specifies the type of extension to append to
the converted value:

Extensiontype argument (integer) extension
--------------------------------------------------------------------------
0 no extension
(answer will be a number only)

1 append the standard abbreviation
(g for grams, kg for kilograms, etc...)

2 append the word
(grams, kilograms)
Category ASP » Math
Hits 381944
Code Select and Copy the Code
<% Private Function StandardToMetric(ByVal StandardMeasure, _ ByVal Conversion, ByVal ExtensionType) Dim tmp, multiplier, extension, ext Select Case UCase( Conversion ) Case "IN-CM" : multiplier = 2.54 : _ extension = "centimeters" : ext = "cm" Case "FT-CM" : multiplier = 30.48 : _ extension = "centimeters" : ext = "cm" Case "IN-M" : multiplier = 0.00254 : _ extension = "meters" : ext = "m" Case "YD-M" : multiplier = 0.914 : _ extension = "meters" : ext = "m" Case "MI-KM" : multiplier = 1.609 : _ extension = "kilometers" : ext = "km" Case "OZ-G" : multiplier = 28.35 : _ extension = "grams" : ext = "g" Case "LBS-G" : multiplier = 453.59 : _ extension = "grams" : ext = "g" Case "OZ-KG" : multiplier = 0.028 : _ extension = "kilograms" : ext = "kg" Case "LBS-KG" : multiplier = 0.454 : _ extension = "kilograms" : ext = "kg" Case "PT-L" : multiplier = 0.473 : _ extension = "liters" : ext = "L" Case "QT-L" : multiplier = 0.946 : _ extension = "liters" : ext = "L" Case "GAL-L" : multiplier = 3.785 : _ extension = "liters" : ext = "L" End Select tmp = FormatNumber(multiplier * StandardMeasure, 2) Select Case CInt(ExtensionType) Case 0 : tmp = Trim( tmp ) Case 1 : tmp = tmp & " " & ext Case 2 : tmp = tmp & " " & extension Case Else : tmp = Trim( tmp ) End Select StandardToMetric = tmp End Function %>

Related Source Codes

Script Name Author
��������������������� VyomWorld
Resistor color code reader A.Chermarajan.
Telephone Directory dhivya
card swapping game (Mini Project) nityanand
simple hangman-pascalsource Seabert
college dirtectory (Mini Project) msridhar
Poll Application John van Meter
ASP Daily Hit Counter. Tejaskumar Gandhi
To avoid null in asp environment using sql Sami
Maklumbalas webmaster
poll John van Meter
EasyASP Template Engine. TjoekBezoer
Basic Calculator using HTML & Javascript. Patrick M. D Souza
What servers support ASP ? VyomWorld
What is ASP? VyomWorld

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=299


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review