I think you are not aproaching the problem the best way...
You are triming the string to find the decimal point and then fixing its length...
I would go with the StrSplit aproach, as it takes a string of any length and split it into any number of strings with a comom separator..
In this case, using "," as the separator we would get alway 2 strings(eg; 12,067 would result in a strig containing "12" and another containing "067")
Then by checking the length of the second (decimal) string you could perform whatever task associated...
Try this:
PS. although I think the code is correct, i cannot trim more than 2 number from the end of the string, can't figure why?