December 11, 2014 at 11:54 am
Comments posted to this topic are about the item Calculate Temperature - Most Advanced UOC
December 16, 2014 at 12:19 pm
Interesting! I think I'd prefer a conversion table with lots of columns such as conversion type (area, mass, etc), long names, abbreviations, descriptions, SI standard names, accepted approximate conversion factors, and your high precision ones. It would be nice to see formatting like mm2. Hmm, preview mode is not showing the superscript for millimeters squared.
December 18, 2014 at 11:13 am
I believe there is an error in this function with regard to F to C & C to F conversions. Try some well known values like:
32F to C - should be 0
0C to F - should be 32
-40 F to C or C to F - should be -40
I agree that a table-based conversion system (for those units with direct convertibility) is a more flexible mechanism...
January 9, 2015 at 8:15 am
Hi,
The correct formula to convert those units are:
select @returnvalue =
case
when @FromConversionUnit = 'DC' and @ToConversionUnit = 'DF' then @UnitValue * 1.8 + 32
when @FromConversionUnit = 'DC' and @ToConversionUnit = 'K' then @UnitValue + 273.15
when @FromConversionUnit = 'DF' and @ToConversionUnit = 'DC' then (@UnitValue -32) / 1.8
when @FromConversionUnit = 'DF' and @ToConversionUnit = 'K' then (@UnitValue -32) / 1.8 + 273.15
when @FromConversionUnit = 'K' and @ToConversionUnit = 'DC' then @UnitValue - 273.15
when @FromConversionUnit = 'K' and @ToConversionUnit = 'DF' then (@UnitValue - 273.15) * 1.8 + 32
when @FromConversionUnit = @ToConversionUnit then @UnitValue * 1.0
end
January 9, 2015 at 8:23 am
sergeg (1/9/2015)
Hi,The correct formula to convert those units are:
select @returnvalue =
case
when @FromConversionUnit = 'DC' and @ToConversionUnit = 'DF' then @UnitValue * 1.8 + 32
when @FromConversionUnit = 'DC' and @ToConversionUnit = 'K' then @UnitValue + 273.15
when @FromConversionUnit = 'DF' and @ToConversionUnit = 'DC' then (@UnitValue -32) / 1.8
when @FromConversionUnit = 'DF' and @ToConversionUnit = 'K' then (@UnitValue -32) / 1.8 + 273.15
when @FromConversionUnit = 'K' and @ToConversionUnit = 'DC' then @UnitValue - 273.15
when @FromConversionUnit = 'K' and @ToConversionUnit = 'DF' then (@UnitValue - 273.15) * 1.8 + 32
when @FromConversionUnit = @ToConversionUnit then @UnitValue * 1.0
end
+1
OP function complete nonsense
January 19, 2015 at 2:56 am
Hi,
What do you mean OP function???
January 19, 2015 at 3:01 am
I'm sorry, OP is an abreviation for Original Poster
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply