Link to home
Start Free TrialLog in
Avatar of bcllc
bcllc

asked on

Convert/cast a decimal to a string (without rounding)

Simple one here, I've got two fields, lotSize (decimal 18,2) and lotSizeType (varchar(50)), which store things like 2.34 + Acres, or 12345 Square Feet. I've got an SP where I want to get the EXACT value out of lotSize and append it to lotSizeType as a string:

SELECT lotSize + ' ' + lotSizeType AS lotSize
FROM Listings
 

What I currently have is:

SELECT LTRIM(STR(lotSize)) + ' ' + lotSizeType AS lotSize
FROM Listings



This is rounding the lotSize value, and so instead of 4.84 Acres, I get 5 Acres. How best to CAST/CONVERT/ETC?
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada 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