LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format to Without Space Between Number and Unit


@paul_a_cardinale wrote:

@PhillipDBrooks wrote:

If units are used, you can use the following format for an SI formatted value

 

%_3{V}p


That moves the space, but doesn't eliminate it.  Also, it only works if the physical quantity is voltage; doesn't work for other physical quantities.


alexderjuengere_0-1776763315740.pngalexderjuengere_1-1776763381963.png

 

Besides Voltage, the {} also works for Gauss and Tesla

 

I don't have to use it often, but when I do, I appreciate the built-in Unit Conversion e.g. CGS to SI System

0 Kudos
Message 11 of 24
(292 Views)

@paul_a_cardinale wrote:

@Yamaeda wrote:

Unit agnoistic with space moved, but not suppressed.

Yamaeda_0-1776697012863.png

 


Not unit agnostic.  It assumes that the unit is a single character (often it is not).


Right! I didn't think about that, you have to cut at space instead.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 24
(269 Views)

It is not exactly what you mean (it does not use the unit of the numerical), but here is a univeral number formatter with units included. I use it to display all my numerical values. It also gives the number and unit separately. The caller then has an indicator for both the value and unit. This allows you to nicely align multiple indicators vertically.

 

Add SI unit.png

Basjong53_1-1776938896866.pngBasjong53_2-1776938933520.png

 

 

Message 13 of 24
(170 Views)

@paul_a_cardinale wrote:

@Yamaeda wrote:

Unit agnoistic with space moved, but not suppressed.

Yamaeda_0-1776697012863.png

 


Not unit agnostic.  It assumes that the unit is a single character (often it is not).


Attempt 2 🙂

Yamaeda_0-1776958941797.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
Message 14 of 24
(134 Views)

@Yamaeda wrote:

[...]

Attempt 2 🙂

 

[...]


never surrender ; )

0 Kudos
Message 15 of 24
(122 Views)

@Yamaeda wrote:


Attempt 2 🙂

Yamaeda_0-1776958941797.png

 


Good attempt, but unfortunately no space between numeral and unit appear, usually it should be "456 kPa", instead of "456kPa" (from Typography point of view).

0 Kudos
Message 16 of 24
(99 Views)

Fun exercise in string manipulation. Here is a version that works for numerical values with a unit.

Kudos to @Yamaeda for getting the unit using the format string function. I didn't know it kept the unit in the output string!

Add SI Unit.png

Basjong53_1-1777011144682.png

 

 

0 Kudos
Message 17 of 24
(91 Views)

@Andrey_Dmitriev wrote:

Good attempt, but unfortunately no space between numeral and unit appear, usually it should be "456 kPa", instead of "456kPa" (from Typography point of view).


When i went to school we often wrote it without space. It seems it's standardized to a space nowadays.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 24
(72 Views)

Hi Yamaeda,

 


@Yamaeda wrote:
When i went to school we often wrote it without space. It seems it's standardized to a space nowadays.

"Nowadays" is atleast 30 years old (when I wrote my diploma thesis)!

 

That's the German regulation, I already linked to the NIST rules in message #2.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 24
(49 Views)

Then it turns to this: 

Yamaeda_0-1777021892688.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 24
(45 Views)