05-29-2026 11:04 AM
When my cheap scope outputs measurements, it sends a numeric value, and optional metric prefix, and an optional unit string; with no spaces between them.
I've got code working that does the parsing, but it's kind of ugly. Can anyone come up with something cleaner?
05-29-2026 02:25 PM
I added a comment to the end of your previous post about SI units.
You can tweak it a bit, (remove the space between digits and magnitude) but it should be able to parse a wide range of values.
Solved: Re: Format to Without Space Between Number and Unit - Page 4 - NI Community
05-29-2026 02:33 PM
I posted an example of parsing an SI formatted string in your previous post
Solved: Re: Format to Without Space Between Number and Unit - Page 4 - NI Community
05-29-2026 04:54 PM
05-29-2026 05:01 PM
Second version if you don't care if the units are in SI base units or not:
(Might need some additional support if there are more spaces somewhere between the number and unit)
05-29-2026 05:04 PM
I think you could use.. %f to grab the base 10 mantisa. Then concat "1" and next char. Then %u for the exponent. A quick run through Multiply would work after that. If next char isn't a valid metric Prefix %u =1 and %f*%u=%f and next char is part of the unit string.