I have a list of prices with decimals.
Example: 0.513 0.35135 1.6583
I'm trying to select the length of the decimal digits. Here's what I mean: 0.513 | length=3 0.35135 | length=5 1.6583 | length=4
I tried converting the numbers to text, but it doesn't seem to provide correct results:
select price, length(cast(price as text)) from table.prices
I also tried this conversion method: "length(price::text)"
Any advice on how I can achieve this?