https://ajaydwivedi.com/tsql/cast-on-variable-scale/
Get Decimal Scale Based on Variable Value