Dirty but working version of counting decimals in the string