Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server DECIMAL function


BASE2DECIMAL
Updated: 25 April 2017

Use the scalar function BASE2DECIMAL to convert a text representation of a number in a given base into a decimal number.

Syntax
SELECT [wct].[BASE2DECIMAL] (
   <@text, nvarchar(4000),>
  ,<@Radix, int,>)
Arguments
Input NameDescription
@textThe text representation of a number in the specified radix (base)
@RadixThe radix (base) used to generate the text representation
Return Type
float
Remarks
  • LEN(@text) > 0.
  • 2 ≤ @radix ≤ 36.
  • If @radix IS NULL then @radix = 10.
  • Available in XLeratorDB / math 2008 only
Examples
Example #1

In this example we convert the hexadecimal number 'FF'.

SELECT
    wct.BASE2DECIMAL('FF',16) as [BASE2DECIMAL]

This produces the following result.

See Also


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service