03-19-2023 12:42 AM
I am working on a school project and All i need is integer number to Decimal number. Number input number output. I see that there is number to Hex string conversion but not to decimal. It is my first time using labview. Please help
03-19-2023 08:02 AM
It is under Number >> Conversion palette.
03-19-2023 10:11 AM
Are you talking about numeric values (from, say, Controls or Indicators on the Numeric Palette for the Front Panel) or string values that can represent numeric values in various string formats, such as Integer (no decimal point, only "whole numbers"), various "Floating point" representations (Sgl, Dbl, Extended Precision), and in different "encodings", such as Decimal, Hexadecimal, or Binary?
It always helps us to help you if you include more information about the (school) assignment (in your native language, and, if possible, in English), and your existing LabVIEW code (so we can see what you have tried, and how we can better help you to learn).
Bob Schor
03-19-2023 10:43 AM
@Tj.adi017 wrote:
I am working on a school project and All i need is integer number to Decimal number. Number input number output. I see that there is number to Hex string conversion but not to decimal. It is my first time using labview. Please help
From your description I think you do not need to change the integer VALUE at all! You simply need to change the display FORMAT. Any numeric Integer control, indicator or constant has the option of showing its VALUE in Binary, Octal, Decimal or Hexadecimal FORMAT by simply selecting the format from the right-click options. You can even show the display format glyph! (b, o, d or x) search the help file and the example finder to gain understanding.
03-19-2023 12:23 PM - edited 03-19-2023 12:25 PM
@Tj.adi017 wrote:
I am working on a school project and All i need is integer number to Decimal number. Number input number output. I see that there is number to Hex string conversion but not to decimal. It is my first time using labview. Please help
Integers can be displayed in decimal (using characters 0..9), hexadecimal (0..F), octal (0..8) or even binary (0..1). The display format is just a cosmetic property. Floating point number can be truncated to integers by eliminating (or not displaying) the decimal delimiter and fractional part.
Integer datatypes can go to about 20 decimal digits (U64), so if your numbers need more, you need to implement some bignum math.
As you can tell from all the answers, your question is completely ambiguous, or even nonsensical!
It is not a LabVIEW problem, but a problem of understanding datatypes and formats, irrespective or programming language.
So what do you have and what do you want to get? Be very specific!
03-20-2023 12:50 AM
I am working on a school project and All i need is Decimal number to Binary number. Decimal Number input in number control and binary number output in Number indicator. For example I want type in 12 in the number control box and get an output of 1100 in thr number indicator. I see that there is number to Hex string conversion but not to binary. It is my first time using labview. Please help.
Thanks. I want it as simple as possible.
03-20-2023 01:41 AM
opening a new thread does not solve your homework 🙂
see: Integars Decimal to Binary - NI Community
If you want to display an integer in binary form on the front panel, then look for the "radix" option of the numeric indicator. If you want to output a string with "0" and "1" characters, then look for "Format inot String" and/or "Format Value". If you should to do more by yourself, look for "Number To Boolean Array" or use the very basic functions "Locical Shift" and the other basic boolean operators.
Be creative and have fun with your homework.
03-20-2023 09:53 AM - edited 03-20-2023 10:24 AM
You don't really need any code, just an integer control connected to an integer indicator and adjust the display format for each as desired.
A much more interesting problem would be to solve it by implementing the actual math. Try it! You also need to decide what should happen if the number is negative.