LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1000 separators in indicators and controls

How can I display long numbers in indicators and/or controls using 1000 separators?

e.g. 9'000'000'000 instead of 9000000000 

 

PS: Using Labview 7.1 

0 Kudos
Message 1 of 8
(4,833 Views)
You would have to use string controls/indicators and convert the string to numbers and vice versa.
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 8
(4,816 Views)

But this is quite tedious to do. I can hardly believe that i'm the only who thinks that this should be automatically implented.

Thanks anyway. 

0 Kudos
Message 3 of 8
(4,808 Views)

UMü wrote:

But this is quite tedious to do.


Not if you write a Vi function to do it for you! Number and seperator character as inputs, string as output.

_____________________________
- Cheers, Ed
0 Kudos
Message 4 of 8
(4,803 Views)

here's one way to do it for  I32 numbers. It can be extended for other types.

 

Dave

 

 

 

 

Message Edited by DavidU on 10-09-2008 02:35 PM
Download All
Message 5 of 8
(4,792 Views)

"yenknip" <x@no.email> wrote in message
news:1223559604648-789616@exchange.ni.com...
> UM&uuml; wrote:
> But this is quite tedious to do.
> Not if you write a Vi function to do it for you! Number and seperator
character as inputs, string as output.

I think UMu is right, it is tedious.

Even if you make a VI, a string control won't behave as a numeric. For
example, you don't have the increment buttons. And you can't type some
characters in a numeric (e.g. "q"), but you can type them in a string. So
you need to catch key down and key repeat events...

So you need to put another numeric behind each string control, and catch
value change events of the numeric, so you know your string control needs to
be updated.

I'd make a numeric, and put a string control over it. When the numeric gets
a value change, update the string. When the string gets a value update, put
the value into the numeric text property, and read it back to convert it's
value into a string with seperators.

If you need to do it for 20 controls, you should try to get it to work
without copying the event cases 20 times. For instance, put all references
in an array, and register it as user event...

Still, quite tedious...

You can even try to make an XControl out of it, but those have there own
problems...

Regards,

Wiebe.


0 Kudos
Message 6 of 8
(4,759 Views)

I agree that having the ability to show a thousands separator in numeric controls and indicators would be a good thing.  It would have to be built into the display format options of the control.  I believe I even put in a product suggestion for it one time.  I would recommend that you file a product suggestion for this as well.  Hopefully if enough people ask, we will eventually get that option.

 

I imagine this would be something that is based off the operating system as default, and use other characters if desired.  I had never seen an apostrophe used before as a thousands separator, but if that's what you want ....

 

Likewise, to me, a comma is the normal thousands separator, but some of those European countries like to mix it up with the decimal point.

 

One other property that would need to be defined is whether you use the separator if the number is over a thousand but less than ten thousand.  For example, for 1 million 1,000,000 would look right and be easier to read than 1000000.

For over ten thousand a number like 33,123 would look right as opposed to 33123.  If it was under ten thousand, you could have 5000 or 5,000.  I would say either of these would be equally good.

 

To go another step further, would there be a desire to group fractional numbers so that the digits after the decimal point are grouped in 3's, perhaps with a space.  For example,  0.000 001 245would be an easier to read format than 0.000001245

0 Kudos
Message 7 of 8
(4,712 Views)
You could use an excel table to show the data and use the 1000 separator when formatting the number.
0 Kudos
Message 8 of 8
(4,704 Views)