Link to home
Start Free TrialLog in
Avatar of jwebster77
jwebster77

asked on

FOrmat Float

Hello all, I have a insert statement (below) in which the @pDifference is a float.  If the variable contains 2.7777764646 for example, I want to format so that the insert just puts 2.7 into the database.  Please help!  Urgent!
Avatar of jwebster77
jwebster77

ASKER

cast(@pDifference as decimal(5,1))

This is how I did it for anyone interested.
SELECGT ROUND(@pDifference, 1) AS RoundedValue
ASKER CERTIFIED SOLUTION
Avatar of adathelad
adathelad
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good point.  I am not sure if we want to round down yet or not...  The example show was more for "decimal places" being limited to 1. I'll give you the credit for the answer though, just in case I need to use the floor function!