Grooper 21.00.0082 is available as of 12-12-2023! Check the Downloads Discussion for the release notes and to get the latest version.
Grooper 23.00.0042 is available as of 03-22-2024! Check the Downloads Discussion for the release notes and to get the latest version.
Grooper 23.1.0018 is available as of 04-15-2024! Check the Downloads Discussion for the release notes and to get the latest version.
Options
Need to normalize Percent values
rcawthon
Posts: 4 ✭
I am looking to normalize percent data were some of the data contains percent signs and some are just normal decimal representations. I suspect this has a lot to do with my value extractors. The data needs to be normalized to a decimal, ie 100 = 1.000 Thanks in advance for your help!
Examples:
100%
80.893%
100 %
80.893 %
.0993
1.00000
Examples:
100%
80.893%
100 %
80.893 %
.0993
1.00000
0
Answers
I built something just now to tackle this by controlling formatting via Data Types with child Data Formats controlling the output via capture groups and specific Output Formats.
rkinard@bisok.com
rkinard@bisok.com
rkinard@bisok.com
I'd like to reference the following website:
https://www.regular-expressions.info/lookaround.html
Grooper has built into it the usage of postive look aheads and look behinds, but you have to manually insert the syntax for negative look behinds. In the case of what I build, I needed there to be a difference between the following:
0.12345 %
.12345 %
vs
0.12345
.12345
The percent sign at the end is obviously very important because 0.12345% = 0.0012345 while 0.12345 = 0.12345. The best way I could think to differentiate the two patterns was with the use of the negative look behind on the percentage amounts not using the % sign.
rkinard@bisok.com