Logo

CONVERTVOLUME

Updated 2023-11-09 16:01:13.553000

Syntax

SELECT [westclintech].[wct].[CONVERTVOLUME] (
   <@Volume, float,>
  ,<@From_scale, nvarchar(4000),>
  ,<@To_scale, nvarchar(4000),>)

Description

Convert to and 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.

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 @Volume is being converted from. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.

@To_scale

is the description of the units @Volume is being converted to. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.

Return Type

float

Remarks

Volume unit representations:

{
    "columns": [
        {
            "field": "unit",
            "maxWidth": 200
        },
        {
            "field": "abbrev",
            "maxWidth": 400
        }
    ],
    "rows": [
        {
            "unit": "teaspoons",
            "abbrev": "tsp, tsps, teaspoon, teaspoons"
        },
        {
            "unit": "tablespoons",
            "abbrev": "tbsp, tbsps, tablespoon, tablespoons"
        },
        {
            "unit": "fluid drams",
            "abbrev": "fl dr, fldr, fluid dram, fluid drams"
        },
        {
            "unit": "fluid ounces",
            "abbrev": "fl oz, floz, fl ozs, flozs, fluid ounce, fluid ounces"
        },
        {
            "unit": "cups",
            "abbrev": "cup, cups"
        },
        {
            "unit": "pints",
            "abbrev": "pint, pints"
        },
        {
            "unit": "quarts",
            "abbrev": "qt, qts, quart, quarts"
        },
        {
            "unit": "gallons",
            "abbrev": "gal, gals, gallon, gallons"
        },
        {
            "unit": "cubic inches",
            "abbrev": "in^3, cu in, cu ins, cubic inch, cubic inches"
        },
        {
            "unit": "cubic feet",
            "abbrev": "ft^3, cu ft, cubic foot, cubic feet"
        },
        {
            "unit": "cubic yards",
            "abbrev": "yd^3, cu yd, cu yds, cubic yard, cubic yards"
        },
        {
            "unit": "cubic miles",
            "abbrev": "mi^3, cu mi, cu mis, cubic mile, cubic miles"
        },
        {
            "unit": "imperial ounces",
            "abbrev": "imp oz, impoz, imp ozs, impozs, imperial ounce, imperial ounces"
        },
        {
            "unit": "imperial pints",
            "abbrev": "imp pt, imppt, imp pts, imppts, imperial pint, imperial pints"
        },
        {
            "unit": "imperial quarts",
            "abbrev": "imp qt, impqt, imp qts, impqts, imperial quart, imperial quarts"
        },
        {
            "unit": "imperial gallons",
            "abbrev": "imp gal, impgal, imp gals, impgals, imperial gallon, imperial gallons"
        },
        {
            "unit": "barrels (US beer barrels)",
            "abbrev": "barrel, barrels"
        },
        {
            "unit": "barrels (oil barrels)",
            "abbrev": "bbl, bbls"
        },
        {
            "unit": "bushels",
            "abbrev": "bu, bus, bushel, bushels"
        },
        {
            "unit": "gills",
            "abbrev": "gi, gill, gills"
        },
        {
            "unit": "imperial gills",
            "abbrev": "imp gi, imperial gill, imperial gills"
        },
        {
            "unit": "pecks",
            "abbrev": "pk, peck, pecks"
        },
        {
            "unit": "dry pints",
            "abbrev": "dry pt, dry pint, dry pints"
        },
        {
            "unit": "dry quarts",
            "abbrev": "dry qt, dry quart, dry quarts"
        },
        {
            "unit": "steres",
            "abbrev": "st, stere, steres"
        },
        {
            "unit": "liters",
            "abbrev": "l, liter, liters"
        },
        {
            "unit": "deciliters",
            "abbrev": "dl, deciliter, deciliters"
        },
        {
            "unit": "centiliters",
            "abbrev": "cl, centiliter, centiliters"
        },
        {
            "unit": "milliliters",
            "abbrev": "ml, milliliter, milliliters"
        },
        {
            "unit": "microliters",
            "abbrev": "µl, microliter, microliters"
        },
        {
            "unit": "nanoliters",
            "abbrev": "nl,nanoliter, nanoliters"
        },
        {
            "unit": "picoliters",
            "abbrev": "pl, picoliter, picoliters"
        },
        {
            "unit": "femtoliters",
            "abbrev": "fl, femtoliter, femtoliters"
        },
        {
            "unit": "attoliters",
            "abbrev": "al, attoliter, attoliters"
        },
        {
            "unit": "zeptoliters",
            "abbrev": "zl, zeptoliter, zeptoliters"
        },
        {
            "unit": "yoctoliters",
            "abbrev": "yl, yoctoliter, yoctoliters"
        },
        {
            "unit": "decaliters",
            "abbrev": "dal, decaliter, decaliters"
        },
        {
            "unit": "hectoliters",
            "abbrev": "hl, hectoliter, hectoliters"
        },
        {
            "unit": "kiloliters",
            "abbrev": "kl, kiloliter, kiloliters liters"
        },
        {
            "unit": "cubic meters",
            "abbrev": "m^3, cu m, cu ms, cubic meter, cubic meters, cubic metre, cubic metres"
        },
        {
            "unit": "cubic decimeter",
            "abbrev": "dm^3, cu dm, cu dms, cubic decimeter, cubic decimeters, cubic decimetre, cubic decimetres"
        },
        {
            "unit": "cubic centimeter",
            "abbrev": "cm^3, cu cm, cu cms, cubic centimeter, cubic centimeters, cubic centimetre, cubic centimetres"
        },
        {
            "unit": "cubic millimeter",
            "abbrev": "mm^3, cu mm, cu mms, cubic millimeter, cubic millimeters, cubic millimetre, cubic millimetres"
        },
        {
            "unit": "cubic microns",
            "abbrev": "µm^3, cu µm, cu µms, cubic micron, cubic microns"
        },
        {
            "unit": "cubic nanometers",
            "abbrev": "nm^3, cu nm, cu nms, cubic nanometer, cubic nanometers, cubic nanometre, cubic nanometres"
        },
        {
            "unit": "cubic picometers",
            "abbrev": "pm^3, cu pm, cu pms, cubic picometer, cubic picometers, cubic picometre, cubic picometres"
        },
        {
            "unit": "cubic femtometers",
            "abbrev": "fm^3, cu fm, cu fms, cubic femtometer, cubic femtometers, cubic femtometre, cubic femtometres"
        },
        {
            "unit": "cubic attometers",
            "abbrev": "am^3, cu am, cu ams, cubic attometer, cubic attometers, cubic attometre, cubic attometres"
        }
    ]
}

Examples

select wct.CONVERTVOLUME(100, 'l', 'gals');

Here is the result set.

----------------------
            26.4172052