Skip to main content
Solved

Method for forcing decimal points between numeric characters in a string?


fionasin
Contributor
Forum|alt.badge.img+7

I have various values in a 'code' field.

A sample would be: A33, B111W, B12, C3V etc, etc.

This issue is, there should be decimal points between all numbers, i.e, these should correctly read: A3.3, B1.1.1W, B1.2, C3V. There does not need to be points between the letters.

I can string replace “33” with “3.3” and continue to do that for all values if I have to, but I’m hoping that there is a more efficient way of capturing these values and using regex or something to force decimal points between the numerical characters. I’m not well adept at using the stringformatter, but maybe there is something there? 

Best answer by takashi

Hi ​@fionasin ,

I would use StringReplacer with these parameter settings.

  • Mode : Replace Regular Expression
  • Text To Replace : (\d)(?=\d)
  • Replacement Text : \1.

The regular expression matches any single digit before a digit.

View original
Did this help you find an answer to your question?

takashi
Supporter
  • Best Answer
  • April 2, 2025

Hi ​@fionasin ,

I would use StringReplacer with these parameter settings.

  • Mode : Replace Regular Expression
  • Text To Replace : (\d)(?=\d)
  • Replacement Text : \1.

The regular expression matches any single digit before a digit.


fionasin
Contributor
Forum|alt.badge.img+7
  • Contributor
  • April 2, 2025
takashi wrote:

Hi ​@fionasin ,

I would use StringReplacer with these parameter settings.

  • Mode : Replace Regular Expression
  • Text To Replace : (\d)(?=\d)
  • Replacement Text : \1.

The regular expression matches any single digit before a digit.

This worked great, thank you!!!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings