# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## How to convert a double to a string?

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?

Message 1 of 6
(348 Views)

## Re: How to convert a double to a string?

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?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 2 of 6
(343 Views)

## Re: How to convert a double to a string?

@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.

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
Message 3 of 6
(338 Views)
Solution
Accepted by flycast

## Re: How to convert a double to a string?

@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.

Message 4 of 6
(329 Views)

## Re: How to convert a double to a string?

@crossrulz wrote:
As stated, you should be using "Number To Fractional String" or something similarly named.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 5 of 6
(321 Views)

## Re: How to convert a double to a string?

Yep! Thank you, that is it.

Message 6 of 6
(317 Views)