Login    Register

XLeratorDB/strings Online Documentation

FRAC2DEC


wct.FRAC2DEC

Updated: 30 April 2009

Use wct.FRAC2DEC to convert a fraction, as text, to a numeric value.
 Syntax
SELECT [wctString].[wct].[FRAC2DEC] (
   <@Frac, nvarchar(4000),>)
Arguments
@Frac
is the fraction value, as text, to be evaluated. The @Frac argument can be of data types that are implicitly convertible to nvarchar or ntext.
 
Return Types
float
Remarks
·         FRAC2DEC always returns the floating point value of the fraction.
Examples
 
select wct.FRAC2DEC('355/113')
 
This produces the following result
----------------------
3.14159292035398
 
(1 row(s) affected)


 
select 355/113
 
This produces the following result
-----------
3
 
(1 row(s) affected)
 


select
cast(355 as float)/cast(113.00 as float)
 
This produces the following result
----------------------
3.14159292035398
 
(1 row(s) affected)


  Comments
Add Comment
No Comments Yet


 |  View Topic History  |
Copyright 2010 WestClinTech LLC         Privacy Policy        Terms of Service