10-24-2024 09:51 AM - edited 10-24-2024 09:54 AM
I found this in a post from 2008. Have not tested to confirm if this range is still applicable but it seems to be the case, based on the OP's observations.
10-24-2024 10:10 AM
If this is not in the documentation, then it's still a bug even if it's 100% intentional.
And it IS in documentation. So I now agree it's technically not a bug.
Having just read the documentation I realised I was mentally substituting %p for %g in the code, since we use %p nearly everywhere in our code. We never use automatic formatting, and this example shows why.
I take it back. Not a bug, but your reference to the actual formatting is still the only useful response given in this thread.
10-24-2024 10:13 AM
@altenbach wrote:
@nitad54449 wrote:
Is there a rule for what number of digits are shown as Float or Scientific when using "Automatic Format" ?
Quote from the help:
Automatic formatting—Displays the numeric object in the format that LabVIEW determines is appropriate for the data. LabVIEW chooses either scientific notation or floating-point notation based on the number to format.
The important part of the help to quote here is:
10-24-2024 01:25 PM
Thanks Intaris. Indeed, this is the point I wanted to know !
10-24-2024 02:07 PM - edited 10-24-2024 02:07 PM
I agree this is not a bug and entirely reasonable. Instead of making a long thread here, the exact behavior is easy to determine in minutes with a simple test program.
If is clear where it switches to e-format, and before that two digits of precision are insufficient. There is a reason that the default is 6 digits here and you probably don't want to go lower.
10-24-2024 02:24 PM
I agree it's not a bug.. it's just that without knowing the range of swithing between F and E, it seemed weird.
Thanks
10-25-2024 03:28 AM - edited 10-25-2024 03:49 AM
@nitad54449 wrote:
Thanks Intaris. Indeed, this is the point I wanted to know !
Thank you, I learned through this post also.
We gave up on %g formatting a LONG time ago, so the reasons were no longer in the front of my mind. This post helped me remember why.
Always good to have a refresher from time to time.
The fact that the UI for setting automatic formatting gives no indication of the behaviour is.... OK. So clicking on "Help" should give clarity.... It only says that LV determines the proper formatting, you need to follow another link to "format codes" (which is the part I posted) which actually EXPLAINS the decision behind the scenes. My take-away from this is that the text in the help should include a hyperlink to the "g" portion of the formatting codes (if we want to assume people using the simple UI are even aware that "automatic" equals "%g" formatting). OR make a mention that it uses the %g formatting and then link to the rules of that. A lot of users will not make the jump from the description of the Automatic formatting to the "format codes" hyperlink 30 lines further down the help page in a completely different paragraph.
Is it a big deal? no. Is it optimal? no. Could it be made easier for new users and forgetful old farts like myself, yes.
So while I agree it's not a bug, I think the documentation of the functionality could be improved.
10-25-2024 08:18 AM
@Intaris wrote:
@nitad54449 wrote:
Thanks Intaris. Indeed, this is the point I wanted to know !
Thank you, I learned through this post also.
We gave up on %g formatting a LONG time ago, so the reasons were no longer in the front of my mind. This post helped me remember why.
Always good to have a refresher from time to time.
The fact that the UI for setting automatic formatting gives no indication of the behaviour is.... OK. So clicking on "Help" should give clarity.... It only says that LV determines the proper formatting, you need to follow another link to "format codes" (which is the part I posted) which actually EXPLAINS the decision behind the scenes. My take-away from this is that the text in the help should include a hyperlink to the "g" portion of the formatting codes (if we want to assume people using the simple UI are even aware that "automatic" equals "%g" formatting). OR make a mention that it uses the %g formatting and then link to the rules of that. A lot of users will not make the jump from the description of the Automatic formatting to the "format codes" hyperlink 30 lines further down the help page in a completely different paragraph.
Is it a big deal? no. Is it optimal? no. Could it be made easier for new users and forgetful old farts like myself, yes.
So while I agree it's not a bug, I think the documentation of the functionality could be improved.
I never paid much attention to this either and for the same reason. I just either don't care or explicitly format the output. This was actually good reading.