Try the following in a JavaScript column:
return (p1.toString().split('.')[1] || []).length;

Note: in the example above I configured the Number column as a Text type. I only did that to preserve the formatting - it works the same if it’s configured as a Number type.