LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NUMBER TO STRING, STRING TO NUMBER

THIS IS WHAT I AM TRYING TO ACHIEVE..

INSERTED NUMBER = 1

OUTPUT = 001 <I HAVE DONE THIS.. THE PROBLEM IS...

 

INSERTED NUMBER = 11

OUTPUT IS = 00C  <BECAUSE OF NUMBER TO HEXA STRING FUNCTION.

 

THIS IS WHAT I WANT TO APPEAR

011

 

AND SO ON   012........100....101

 

0 Kudos
Message 1 of 18
(4,113 Views)

Hello,

i need to know ur final data (001, 002,.. 010, 011,.. 100, 101,..) should be in number or string?

 

 

 

S Boopathy Raja

 

0 Kudos
Message 2 of 18
(4,105 Views)

Convert using Number to Decimal String Function with width as 3

Then replace Space with 0,

Then you will get the expected Result.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 18
(4,101 Views)

Even Change of Properties of a Numeric Control/indicator will help you.

 

PaddingZero.PNG

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 18
(4,087 Views)

Post the code you have.

 

You're not describing if you're visualizing strings or numbers. That kind of things are pretty important for understanding your problem (and our answers).

0 Kudos
Message 5 of 18
(4,080 Views)

@1der-er wrote:

THIS IS WHAT I AM TRYING TO ACHIEVE..

INSERTED NUMBER = 1

OUTPUT = 001 <I HAVE DONE THIS.. THE PROBLEM IS...

 

INSERTED NUMBER = 11

OUTPUT IS = 00C  <BECAUSE OF NUMBER TO HEXA STRING FUNCTION.

 


Why use number to Hex String at all???

 

Use "format into string" with the correct "format string" and you are done:

grafik.png

 

Regards, Jens

Kudos are welcome...
Message 6 of 18
(4,073 Views)

@JensG69 wrote:

Why use number to Hex String at all???

grafik.png 


Because...

Spoiler

it works on 1D arrays. And 2D arrays. And clusters. And Arrays of cluster. And cluster of arrays. And... Well, you get the point.

 

It's a bit faster too.

 

Format Into String is usually the end point, as it's much more flexible. But not always. I'd slightly prefer Number to Hex String over Format Into String, if it fits the job.

0 Kudos
Message 7 of 18
(4,063 Views)

wiebe@CARYAFormat Into String is usually the end point, as it's much more flexible. But not always. I'd slightly prefer Number to Hex String over Format Into String, if it fits the job.

But it (ie Number to Hex string) does not do the job - in this case.

Kudos are welcome...
0 Kudos
Message 8 of 18
(4,054 Views)

@JensG69 wrote:

wiebe@CARYAFormat Into String is usually the end point, as it's much more flexible. But not always. I'd slightly prefer Number to Hex String over Format Into String, if it fits the job.

But it (ie Number to Hex string) does not do the job - in this case.


True, the Number to Hex String won't work if you don't want hex string.

 

The answer to "why use Number to Hex String at all", in the general context, still applies. (Just crawling back from my Friday afternoon mistake Smiley Wink).

 

0 Kudos
Message 9 of 18
(4,048 Views)

@JensG69 wrote:

wiebe@CARYAFormat Into String is usually the end point, as it's much more flexible. But not always. I'd slightly prefer Number to Hex String over Format Into String, if it fits the job.

But it (ie Number to Hex string) does not do the job - in this case.


Correct.  And the Number To Decimal String will fill the string width with spaces instead of 0s.  So Format Into String, or even Format Value, inside of a FOR loop would be the way to handle arrays to get what the OP is asking for.


GCentral
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
0 Kudos
Message 10 of 18
(4,047 Views)