05-09-2013 08:15 PM
I was struggling with a bin value (Control) of 0.1 that my FP was refusing to register:
so I looked at the display format and changed it to show 2 digits of precision, like so:
Strangely enough, whatever I would enter 0.1, 0.01, it would always reset to 0...
Hmm...
Then I did something really stupid, which is to look at the "Representation" of my control and..tada! it turned out to be an I32 control.
I am asking: why am I actually capable of adjusting the display format of an I32 to show 2 digits of precision?
I mean what is the intent here, besides playing trick with the unsuspecting developer?
The Property "Format" tab for that type is exactly the same as for a float:
Tab and I get this:
After all, I guess an integer with 9 digits of precision is better than one with none:
05-09-2013 08:19 PM
That is advanced preparation for the fraction integer datatype which will be introduced in LV2547.
Lynn
05-09-2013 09:01 PM
05-09-2013 10:46 PM
For the same reason that %d stands for decimal when formatting a string with a number which has no possiblity of having digits after the decimal
disclaimer: I'm sure there is a valid reason for this
05-10-2013 06:09 AM
@for(imstuck) wrote:
For the same reason that %d stands for decimal when formatting a string with a number which has no possiblity of having digits after the decimal
disclaimer: I'm sure there is a valid reason for this
Actually, there is a very valid reason. Decimal simply means base 10. Just the same way that Binary means base 2, Octal means base 8, and Hexadecimal (often shortened to Hex) is base 16. All of these are dealing with integers. The %d, %b, %o, and %x have been around at least since C got started. They have nothing to do with the English name of decimal point.
Plus, look at your string<->Number conversions. You will see a Decimal String to Number and Number to Decimal String. Those are just using the %d convension.
05-10-2013 01:00 PM
@johnsold wrote:
That is advanced preparation for the fraction integer datatype which will be introduced in LV2547.
Lynn
That's just too funny.
05-10-2013 01:38 PM - edited 05-10-2013 01:39 PM
@Darin.K wrote:
I want to show DBLs in hex myself.
I actually took that seriously for a second and if you actually start from an I32 type and change it to DBL while in the Property Dialog window, you can get there:
Problem is, clicking on hexadecimal (or octal, or binary) doesn't register. The display is stuck wherever it was.
You have to close and reopen the dialog window to get what I think is natural, i.e. grayed out properties that do not make much sense for that type:
But I guess it makes some sense to display an integer with added precision after all ???
05-10-2013 02:07 PM
All decimal digits of an integer are zero. Why shouldn't you be able to display them if you want to?
05-10-2013 02:12 PM - edited 05-10-2013 02:19 PM
It makes a bit more sense when you use the same specifiers with Fixed Point. Although, I never understood the limitation of not being able to display "." as a true radix point. I've yet to see an explaiation why 0d1.5 can be displayed "0b1.1" where "." is the binary point but not an octal point of hexadecimal point
05-10-2013 02:37 PM
@altenbach wrote:
All decimal digits of an integer are zero. Why shouldn't you be able to display them if you want to?
Wait. What?
All digits after the decimal point are zero.