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: 

comma separator for large numbers, how to?

This is a VI (8.6) I have in my assorted code folder. I don't think I ever finished or used it, but it does the basic operation, so it might help you. You should test it properly.

 

Incidently, if you want, OpenG has a VI which coverts a number to English text (i.e. "one hundred and twenty one").


___________________
Try to take over the world!
Message 11 of 26
(2,394 Views)

But I don't want to use a string...

Message 12 of 26
(2,374 Views)

@X. wrote:

But I don't want to use a string...


And the numeric controls don't support displaying the data in parts, as far as I know, so unless you plan on using a picture control or putting the entire result into the format specifier of the numeric (which probably won't help you either, since even if you hide the actual value, it will still be there), I don't think you currently have much of a choice. Like Mark said, you can use an XControl so that the data type of the control is still numeric.


___________________
Try to take over the world!
0 Kudos
Message 13 of 26
(2,342 Views)

This is an on going issue with us as well. From the front panel, the customer will have to enter 9 digits, or portions of them... often. The commas really help the eye keep track of where you are especially when you can adjust any parameter in a 20 GHz span. I see the conversation took place years ago. Certainly we have come far enough to have fixed this important oversite? If any one has noticed movement in this area I would like to know.

0 Kudos
Message 14 of 26
(2,047 Views)
I would like to have good news for you, but in fact the Next Gen Preview isn't offering any kind of formatting for numerics (not even format string). Who knows what NI has in mind...
0 Kudos
Message 15 of 26
(2,036 Views)

@Hobbs23 wrote:

The commas really help the eye keep track of where you are especially when you can adjust any parameter in a 20 GHz span.


I do not know of any traction on this front.  But I have found using the SI notation to help a lot.  Then you can just put in "15.6G" and it is the same as 15,600,000,000.  Not a complete solution, but works for 95% of my applications.  For those who want to set it, the format code I use is "%#p" (the # tells to omit trailing 0s and p is used for SI notation).


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
Message 16 of 26
(2,036 Views)

Hey I do appreciate the vi. I worked it into a tandom string display to test it, using a dbl precision "value" property node from the control knob/digital display. Seems to work fine. The next challenge however will streach my knowledge a bit. The need is to be able to enter in data using a control/indicator on the front panel. It would be fine for the commas to go away when entering data but reappear when hitting the enter key in the proper places. Right now it works fine just minus the commas. Any ideas cautions, or revelations would be greatly appreciated?

0 Kudos
Message 17 of 26
(1,999 Views)

Enter your number in a string control (not bothering for comma formatting, but allowing it). As soon as the user presses enter or clicks outside the control (control loses focus), interpret the string as a double, and reformat the display if needed. No need for a numeric control... I still believe we shouldn't have to go through these hoops though.

Message 18 of 26
(1,987 Views)

Here I also posted a still 'new' old idea 😄

 

Looking at the syntax

 

[%[. || , ||];]%[$][-][+][#][^][0][Width][.Precision || _SignificantDigits][{Unit}][<Embedded information>]Conversion Code

 

 

the  <Embedded information> is currently used only for time formats, but would be ideal to extend to a more general form to choose a thousand seperator (comma, space,\code), or even more fancy stuff ...  Who needs ISDN format in LabVIEW ? 😄

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 19 of 26
(1,974 Views)

I managed to do this:

Num to separated string.png/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 20 of 26
(1,948 Views)