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.
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.
10-26-2020 01:17 PM
Using NXG.
I see Number to Decimal String. When I feed this a value of 123.45 I get string that is only whole digits - 123. I see a little conversion warning when I wire a decimal type to this block.
Is there a block for converting Decimal to string?
Solved! Go to Solution.
10-26-2020 01:19 PM - edited 10-26-2020 01:20 PM
10-26-2020 01:24 PM
@flycast wrote:
Is there a block for converting Decimal to string?
Common mistake. "Decimal" in this case is to imply an integer. As stated, you should be using "Number To Fractional String" or something similarly named.
10-26-2020 01:37 PM - edited 10-26-2020 01:46 PM
@GerdW wrote:
Hi flycast,
in classic LabVIEW the function is called FormatIntoString. Or NumberToFractionalString…
Does NXG provide the same functions?
Why do you use a function named "Decimal" for "fractional" numbers?
Hi Gerd,
That is a very common mistake. Because in the regular English language, Decimal doesn't imply integers. When you hear "decimal" most people think of values after the decimal point.
When you hear "fractional", you think of fractions like 1/2, 2/3, 3/4. Not "decimal" numbers like 0.5, 0.75, 1.82, etc.
NI should have named those functions more clearly in LabVIEW a long time ago. So I completely understand why the original poster and dozens to hundreds of others through the years have made the same mistake.
To flycast, the way NI has used "decimal" on these functions was to represent the decimal numbering system (base 10), as opposed to binary, octal, and hexadecimal. (Bases 2, 8, and 16). More of a computer engineering definition for decimal rather than the common world definition.
10-26-2020 01:40 PM
@crossrulz wrote:
As stated, you should be using "Number To Fractional String" or something similarly named.
10-26-2020 01:42 PM
Yep! Thank you, that is it.