Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server function to convert volume to cubic meters


CUMETERS
 
Updated: 01 December 2008 

Use CUMETERS to convert from barrels (US beer barrels), bbl (oil barrel), bushels, cubic feet, cubic inches, cubic meters, cubic miles, cubic yards, cups, dry pints, dry quarts, fluid drams, fluid ounces, gallons, gills, imperial gallons, imperial gills, imperial pints, imperial quarts, liters, pecks, pints, quarts, steres, tablespoons, or teaspoons to cubic meters.
Syntax
SELECT [westclintech].[wct].[CUMETERS] (
  <@Volume, float,>
 ,<@From_scale, nvarchar(4000),>
 ,<@To_scale, nvarchar(4000),>)
Arguments
@Volume
is any real number. @Volume 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 @Volume. @From_scale must be a valid value as specified in volume unit representations@From_scale must be of a data type that is implicitly convertible to varchar.
 
@To_scale
is the description of the units for that @Volume is to be converted into. @To_scale must be a valid value as specified in volume unit representations. In addition to cubic meters, @To_scale  can be cubic decimeters, cubic centimeters, cubic millimeters, cubic micrometers, cubic nanometers, cubic picometers, cubic femtometers, cubic attometers, cubic zeptometers, cubic yoctometers, cubic decameters, cubic hectometers, or cubic kilometers .@To_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 volume units of measure into cubic meters:
teaspoon
4.9289E-06
tablespoon
1.47868E-05
fluid dram
3.69669E-06
fluid ounce
2.95735E-05
cup
0.000236588
pint
0.000473177
quart
0.000946353
gallon
0.003785412
cubic inch
1.63871E-05
cubic foot
0.02831685
cubic yard
0.7645549
cubic mile
4168182000
imperial ounce
2.84131E-05
imperial pint
0.000568261
imperial quart
0.001136523
imperial gallon
0.00454609
barrel (beer)
0.117347772
barrel (oil)
0.158987304
bushel
0.03523907
gill
0.000118294
imperial gill
0.000142065
peck
0.008809768
dry pint
0.000550611
dry quart
0.001101221
stere
1
liter
0.001
cubic meter
1
 
·         Conversion of metric values (liters and cubic meters) includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Example
 
select wct.CUMETERS(1, 'quart', 'm^3')
Here is the result set
----------------------
0.0009463529
 
(1 row(s) affected)


Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service