04-25-2018 09:18 PM
How do I display the number 1.235G as 1235M in a string display ?
I also need to retrieve the value
Keith
04-25-2018 11:13 PM
@DeOdderKeith wrote:
How do I display the number 1.235G as 1235M in a string display ?
I also need to retrieve the value
Keith
Search for the dot and the letter G. Remove dot, replace G with M. Finally, use the string to decimal number function to get the value...
You can do these steps in many variations, very simple. You can even play with the string functions which use regular expressions, so you could do what you want in a single step...
What did you try so far?
04-26-2018 03:40 AM
04-26-2018 07:42 AM
Thanks for the responses, however, this does not preserve the value of the original number.
I need to extract the number from the resulting string at a later time. Also, this value is written into a database, so future users will need to have the correct value
I've tried various formatting techniques, but all seem to change the original value.
I am looking for an automated way of displaying 1.235G as 1235M
Keith
04-26-2018 07:50 AM
Hi Keith,
however, this does not preserve the value of the original number.
Why not?
My snippet scans the number and reformats it according to your requirement.
Can you attach a VI showing the problem of "not preserving the value"?
I need to extract the number from the resulting string at a later time.
Why don't you keep the original string/value instead of the "resulting string"?
I've tried various formatting techniques, but all seem to change the original value.
What have you tried? Can you attach your VI?
Why don't you keep the "original value" and only change the value for this string display?
I am looking for an automated way of displaying 1.235G as 1235M
See my snippet…
04-26-2018 08:03 AM
You are CORRECT.
My Mistake. I did not try to run your code...
Kudos
Solution