This gives the correct results, but I'm not sure that it works well enough for you, and I have not tried it with data other than the examples you provided:
; with money_cte ([Key], [someMoney]) as ( select 1, cast(5.00 as money) union select 2, cast(5.002 as money) union select 3, cast(5.0001 as money) ) select [Key], [someMoney], abs(floor(log10([someMoney] - round([someMoney], 0, 1)))) as places from money_cte where [someMoney] - round([someMoney], 0, 1) <> 0 union select [Key], [someMoney], 2 as places from money_cte where [someMoney] - round([someMoney], 0, 1) = 0
source share