Skip to main content

Hi Folks,

I am working a problem where I need to evaluate the numbers on both sides of a decimal separately. I want to do some special rounding and since this cannot be done out of the box, I thought regex might be the answer. If I have a number like 125.32, I would like break it out into two numbers (125 and 32) the amount of digits on either side of the decimal point can vary.

15.5 split to 15;5

1254.32695 split to 1254;32695

.4 split to 0;4

bottom line, I want to evaluate the value right of the decimal and if it is <= .5 make it .5 and if is > .5, increase the integer on the left of the decimal by 1.

Any thoughts on the regex?

Thanks!

Patrick

I got it. I was able to just do the simple regex below and it split. Now I just need to break it out in a for each loop to handle the parts of the number.

181667_pastedImage_0.png


Reply