Try converting to float first, like this:
CAST (CAST (v1 AS float(24)) AS decimal(18, 13))