Convert/cast a decimal to a string (without rounding)
Posted on 2008-06-16
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
What I currently have is:
SELECT LTRIM(STR(lotSize)) + ' ' + lotSizeType AS lotSize
This is rounding the lotSize value, and so instead of 4.84 Acres, I get 5 Acres. How best to CAST/CONVERT/ETC?