02-01-2020 04:13 PM
@rolfk wrote:
@paul_a_cardinale wrote:
If the number is in a control or indicator, you can do it like this:
I wouldn't account that as solution for floating point numbers. It will only depend on the selected display format and has almost nothing to do with the actual number.
Very old thread resurrection! 😄
As long as we work with positive integer values (DBL representation), a small change would make it work:
(Still, my earlier solution is probably better... :))
02-02-2020 06:46 AM
@altenbach wrote:
Very old thread resurrection! 😄
Didn't check the post date but it appeared on the first page of the overview and was marked as solution.
As long as we work with positive integer values (DBL representation), a small change would make it work:
I would think that changing the front panel appearence of a control for such side effects is not what one usually should attempt to do. Definitely would consider the original approach of just formatting the number into a string and measure the length a lot better and personally prefer your mathematical approach above anything else.
02-02-2020 01:41 PM
Oh, yes, you are definitely right that it is not the solution and I unmarked it as such. 😄 Not sure why the thread was showcased on the front page....
(It gets even weirder if you would blindly use a "%d" format on an DBL. While one might think that this will correctly display all possible DBL values as integers, the display will be coerced to the valid I64 range and thus wrong for large numbers... :o. For example 1E88 will be displayed as 9223372036854775807, not quite the same. 😉 I think this has been discussed in the past)