LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display numeric as standardized scientific notation

This must have been discussed before but I cannot find it.

 

In LabVIEW, scientific notation is displayed in the form "1.234E+5", but the standard for scientific notation is 1.234 x 105.   I would like both numeric indicators and graph scales be able to display like that. Is there a reasonable way to get that? I’m guessing no since there is a superscripted character in there.

 

But can NXG do it?

At least it would be nice to get graph scales in this format (whatever it is called): 105.

 


Bonus points to anyone finding a way of formatting SI units the standardized way, with a space between the value and the unit, like "2.4 GHz", standard SI style convention. And no, "%#p Hz" is incorrect.

Certified LabVIEW Architect
0 Kudos
Message 1 of 13
(3,832 Views)

Hi thols,

 


@thols wrote:

This must have been discussed before but I cannot find it.


Yes. Like here

 

I guess NI follows the "industry standards" with same (or very similar) format codes as in any other programming language…

 

(You can always create your own formatting/conversion routines to create 2D pictures containing the requested "1.2345×10³"…)

 


@thols wrote:

but the standard for scientific notation is 1.234 x 105


Is it really "standard" to place the char "x" (ASCII-120) in between the numbers? 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(3,821 Views)

@thols wrote:

This must have been discussed before but I cannot find it.

 

In LabVIEW, scientific notation is displayed in the form "1.234E+5", but the standard for scientific notation is 1.234 x 105.   I would like both numeric indicators and graph scales be able to display like that. Is there a reasonable way to get that? I’m guessing no since there is a superscripted character in there.

 

But can NXG do it?

At least it would be nice to get graph scales in this format (whatever it is called): 105.

 


Bonus points to anyone finding a way of formatting SI units the standardized way, with a space between the value and the unit, like "2.4 GHz", standard SI style convention. And no, "%#p Hz" is incorrect.


It must be some kind of standard, because if you paste "1.234E+5" (sans quotation marks) into any spreadsheet application, you get the number.  I think this must be a standard for SI units in a computer-ready format because you'll find almost every instrument will output numbers in this fashion.  I've never seen an instrument return numbers in what I would call "human-formatted" SI units.  Takes too many extra characters.  1.234E+5 or 1.234 x 10^5.  Too much wasted space - half again as much space - taken up conveying exactly the same information.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 13
(3,779 Views)

If forgot to mention that your request is entirely reasonable, though.  And as for part 2 of your post, that really annoys me as well.  There should be a space, and the fact that there isn't makes that format useless to me.  (Probably my tendencies towards OCD is in play here.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 13
(3,772 Views)

@billko wrote:

And as for part 2 of your post, that really annoys me as well.  There should be a space, and the fact that there isn't makes that format useless to me.  (Probably my tendencies towards OCD is in play here.)


I just don't have the space and I am content (%#pHz).  There was some discussion about this in the Rube-Goldberg thread.


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
0 Kudos
Message 5 of 13
(3,760 Views)

@crossrulz wrote:
There was some discussion about this in the Rube-Goldberg thread.

It wouldn't surprise me if that discussion was the trigger for this thread!


GCentral
0 Kudos
Message 6 of 13
(3,741 Views)

@GerdW wrote:

Hi thols,

 


@thols wrote:

This must have been discussed before but I cannot find it.


Yes. Like here

 

I guess NI follows the "industry standards" with same (or very similar) format codes as in any other programming language…

 

(You can always create your own formatting/conversion routines to create 2D pictures containing the requested "1.2345×10³"…)

 


@thols wrote:

but the standard for scientific notation is 1.234 x 105


Is it really "standard" to place the char "x" (ASCII-120) in between the numbers? 😄


Speaking as a Mathematician, I'd say "No, that should be a Times sign".  3 × 10 is different from 3 x 10.  I typed the Times sign by using the numeric keypad and Alt-0215.

 

Bob "Picky" Schor

Message 7 of 13
(3,738 Views)

@thols wrote:

This must have been discussed before but I cannot find it.

 

In LabVIEW, scientific notation is displayed in the form "1.234E+5", but the standard for scientific notation is 1.234 x 105.   I would like both numeric indicators and graph scales be able to display like that. Is there a reasonable way to get that? I’m guessing no since there is a superscripted character in there.

 

But can NXG do it?

At least it would be nice to get graph scales in this format (whatever it is called): 105.

 


Bonus points to anyone finding a way of formatting SI units the standardized way, with a space between the value and the unit, like "2.4 GHz", standard SI style convention. And no, "%#p Hz" is incorrect.


Also, can you get the exponent in prefix sizes? I don't have LV on this computer so can't check right now. On a calculator you can often press ENG to write it in 'engineering' units, so 1.234E5 becomes 123.4E3 (the exponent is always a factor of 3).

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 13
(3,727 Views)

Hi Yamaeda,

 


@Yamaeda wrote:


Also, can you get the exponent in prefix sizes? I don't have LV on this computer so can't check right now. On a calculator you can often press ENG to write it in 'engineering' units, so 1.234E5 becomes 123.4E3 (the exponent is always a factor of 3).

From the LabVIEW help on "format strings":

Add ^ to change to engineering notation where the exponent is always a multiple of three.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 13
(3,703 Views)

@cbutcher wrote:

@crossrulz wrote:
There was some discussion about this in the Rube-Goldberg thread.

It wouldn't surprise me if that discussion was the trigger for this thread!


I thought this sounded familiar!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 13
(3,696 Views)