Home Forums SQL Server 7,2000 T-SQL Need to display decimal value converting it to non decimal 13 character numeric string replacing unused character positions with ''0'' RE: Need to display decimal value converting it to non decimal 13 character numeric string replacing unused character positions with ''''0''''
Ninja's_RGR'us
SSC Guru
Points: 294069
More actions
November 8, 2006 at 12:35 pm
#670687
This would normally be handled client side but what the heck :
DECLARE @n AS Decimal(18,2)
SET @n = 150
SELECT RIGHT(REPLICATE('0', 13) + CONVERT(VARCHAR(15), @n), 13)