From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Number to Words in LabVIEW

Solved!
Go to solution

Hi all,

 

As per the title shown, i need helps on converting number to words using LabVIEW.

For example, 100 to one hundred.

Can anyone help? Thanks in advance.

 

Best regards,

Crystal

0 Kudos
Message 1 of 10
(3,554 Views)

A simple google search will find you many algorithm in text based languages. There are two parts:

 

  1. parsing the number into its digits
  2. using a lookup table to find the correct word based on digit position and value, taking care of special handling of the special words for e.g. 11-19, etc.

What have you tried? What is giving you problems?

0 Kudos
Message 2 of 10
(3,550 Views)

Hi  

 

0 Kudos
Message 3 of 10
(3,540 Views)

Hi 123,

 


@123xj wrote:


You just implement the very same algorithm in LabVIEW. Should be as easy as with text-based programming languages…

 


@123xj wrote:


Do you search for "ready-to-use solutions" for your homework?

Or should you learn LabVIEW by solving that homework on your own?

(An algorithm is a description on how to solve a problem - it is not a "ready-to-use solution"!)

 

I repeat what Christian already asked: What have you tried? Where are you stuck? Why don't you attach your current VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,522 Views)

Hi 

 

 

 

0 Kudos
Message 5 of 10
(3,516 Views)

Hi 123,

 


@123xj wrote:


Then place all this code into a VI.

 


@123xj wrote:


Save the VI created in the first step using the name "num2word" and setup its connector pane.

Now you got your "command <num2word>" for simple usage…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,495 Views)
Solution
Accepted by topic author 123xj

OpenG has a 'Number to Proper English Text' VI and a 'Place Number to Proper English Text' VI in the string palette.

You find OpenG in the LabVIEW Tools Network

 

Message 7 of 10
(3,485 Views)

Hi GerdW,

 

Thanks for taking time to reply my question.

 

Maybe you should just simply reply me there is no ready to use function in LabVIEW that can convert number to word. Thanks.

0 Kudos
Message 8 of 10
(3,482 Views)

Hi 123,

 


@123xj wrote:

Maybe you should just simply reply me there is no ready to use function in LabVIEW that can convert number to word.


I'm no Python expert, but I guess that "num2word" is not a part of the Python core implementation. It most probably comes with an additional toolkit/module/package (whatever they call it) you need to install…

The same applies to LabVIEW: such a function is not part of LabVIEW core, but you can create it on your own!

 

(Btw. your question is a perfect example why this specific function should NOT be part of a core package: there are way too many languages with way too many conversion rules out there to support them all with such a command!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(3,478 Views)

Hi UliB,

 

Thanks for the reply.

That's exactly what i need 😀

 

Best regards,

 

0 Kudos
Message 10 of 10
(3,465 Views)