LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format to Without Space Between Number and Unit

The following yields "123m V" but I need "123mV".  Is there a format specifier option that will inhibit the space between the number and the unit?

 

paul_a_cardinale_0-1776255334878.png

 

0 Kudos
Message 1 of 7
(377 Views)

Hi Paul,

 


@paul_a_cardinale wrote:

The following yields "123m V" but I need "123mV".


"Interesting" behaviour…

(I stopped using units more than 10 years ago.)

 


@paul_a_cardinale wrote:

Is there a format specifier option that will inhibit the space between the number and the unit?


Not that I know of.

You could strip the unit before the FormatIntoString function and include the "V" in the format string. Then you would get "123mV"…

 

Btw. the ISO standard for creating text with "values with physical units" requires a space between value and unit ("123 mV"). See this (item #15)! (I typically use a nbsp in text editors…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(363 Views)

I remember submitting a related bug 10-15 years ago. I would have to dig around to see if I still have the scenario.

 

To your exact scenario, I just don't use units.



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 7
(362 Views)

@crossrulz wrote:

I remember submitting a related bug 10-15 years ago. I would have to dig around to see if I still have the scenario.

 

To your exact scenario, I just don't use units.


This is what I used in multiple situations and swear by.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 Kudos
Message 4 of 7
(331 Views)

@crossrulz wrote:

I remember submitting a related bug 10-15 years ago. I would have to dig around to see if I still have the scenario.

 

To your exact scenario, I just don't use units.


 

This only works well without units on the value. (One of the reasons I never use units!)

 

The  problem is that the OP uses units on the constant. 

0 Kudos
Message 5 of 7
(289 Views)

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

 

%_3{V}p

Message 6 of 7
(192 Views)

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

Message 7 of 7
(161 Views)