sql server - SQL loses decimals after multiplication -


i have table includes:

count    risk 35       0.6456000000 11       0.5234000000 4        0.8431000000 

i need column multiply 2 columns. i'm getting result of:

total 35 11 4   

count - int

risk - varchar

sql rounding decimals 1. i've tried casting decimal, numeric , multiplying 1.0. need retain decimals actual calculation. great

convert result decimal

select     convert(decimal(16,10), count * risk) decimalresult dbo.whatever; 

or convert count decimal

select cast(count decimal(16,10)) * risk 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -