This is an even simpler option:
WITH VTE AS
(
SELECT
*
FROM
(
VALUES (3),
(25.75),
(12),
(125.8),
(1000),
(1857.5)
) V (I)
)
SELECT VTE.I, FORMAT(I*10, '0000') AS LeadingZeros FROM VTE;
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question