Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert weight to tonnes


TONNES
 
Updated: 01 December 2008 

Use TONNES to convert from drams, grains, grams, hundredweights, ounces, pennyweights, pounds, stones, tonnes, tons, troy pounds, or troy ounces to tonnes.
Syntax
SELECT [westclintech].[wct].[TONNES] (
  <@weight, float,>
 ,<@From_scale, nvarchar(4000),>)
Arguments
@Weight
is any real number. @Weight is an expression of type float or of a type that can be implicitly converted to float
@From_scale
is the description of the units for @Weight. @From_scale must be a valid value as specified in weight unit representations@From_scale must be of a data type that is implicitly convertible to varchar.
 
Return Types
float
Remarks
·         The following table is a representation of the conversion of one of the weight units of measure into tonnes:
grains
0.00000006480000
drams
0.00000177184520
ounces avoirdupois
0.00002834952000
pounds avoirdupois
0.00045359237000
stones
0.006350293
hundredweights
0.04535923700000
tons
0.90718474000000
pennyweights
0.00000155517384
ounces troy
0.00003110347680
pounds troy
0.00037324172160
grams
0.00000100000000
tonnes
1.00000000000000
 
·         Conversion of grams includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.TONNES(100, 'lbs')
Here is the result set
----------------------
0.045359237
 
(1 row(s) affected)


Copyright 2008-2013 WestClinTech LLC         Privacy Policy        Terms of Service