cancel
Showing results for 
Search instead for 
Did you mean: 

Metric String to Number

SOLVED
Hooovahh
Proven Zealot
Solved!

Metric String to Number

Does there exist a way to convert the string "1ms" into the number 0.001?  Same with the µ (micro), k (kilo), M (mega) and any other metric symbols?  I can do this manually no problem but I thought someone may have done this already.  Thanks.

5 REPLIES 5
JÞB
Knight of NI
Solution

Re: Metric String to Number

Message contains an image

%p my good friend.

!0.png


"Should be" isn't "Is" -Jay
Tags (1)
Darin.K
Trusted Enthusiast

Re: Metric String to Number

try that one with '1ms' as the input as the original post stated.

JÞB
Knight of NI

Re: Metric String to Number

Yes there is a limitation,  Nothing a regex can't handle.


"Should be" isn't "Is" -Jay
Highlighted
Hooovahh
Proven Zealot

Re: Metric String to Number


@Darin.K wrote:

try that one with '1ms' as the input as the original post stated.


Yes I noticed that right away but in this case I can simply the last char.  Glad it is so simple.

crossrulz
Knight of NI

Re: Metric String to Number


@Darin.K wrote:

try that one with '1ms' as the input as the original post stated.


It will be easy as soon as NI fixes CAR 425562...  I've ran into this enough times.  I ended up putting in spaces between the prefix and the unit to get the Scan From String to work properly.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5