06-16-2008 12:52 PM
altenbach wrote:
Converting to a fractional format string is inappropriate for integers, use "number to decimal string".
06-16-2008 01:11 PM
Ravens Fan wrote:
How bad is it to use Number to Fractional String over Number to Decimal String? Any performance cost? I believe he used that because that is what I used in my example. I picked fractional string because usually when I need to do a conversion from number to string, I am using dealing with "fractional numbers" and not integers. Even though he is using integers now, I felt there is always a possibility that he winds up doing some math on that number (scaling??) and it turns into a number with a "fractional" component.
Ravens Fan wrote:
I have one comment about the "number to decimal string". I think it is poorly named.
06-16-2008 01:15 PM
06-16-2008 01:41 PM - edited 06-16-2008 01:42 PM
altenbach wrote:No worries about performance. I just believe in using the right tool for the right job. 😉 Sure you can use a pair of pliers to loosen a nut or a butter knife to tighten a bolt 😄Here you need to wire one additional input for the desired outcome (decimal places=0), cluttering up the code. Like Tiger Woods, I strongly believe that if things can be done in fewer strokes, it should be done in fewer strokes. While not an error, I would call using the "fractional" instead of the "integer" sibling for integers a bogey. 🙂You're right. And if Tiger had one less bogey yesterday, he wouldn't need to be playing 18 holes today.Obviously You haven't been programming LabVIEW as long as I did. Many, (many!) versions ago, the naming of these conversion tools was much more confusing. How would you name them?
Only a few years, starting with 7.1. I think like Smercurio said, Decimal Integer String like it calls its output, that way it is decimal for the number system, but integer to that it is obvious its result is an integer and not a fully decimal number where you have digits after the decimal point. Is the fractional string function polymorphic in the background? I realized looking at it again that its input terminal is naturally an orange double. But if you hook up a blue I32 wire to it, it takes it and doesn't show a coercion dot.
Decimal, (like octal, hexadecimal, etc) is a numeral system, so I think the usage here is correct.. The decimal seperator is just a cherry on top of it for the special case of formatting non-integer numbers in decimal format. 😄
06-16-2008 01:45 PM
06-16-2008 04:09 PM
06-16-2008 06:24 PM
altenbach wrote:Obviously You haven't been programming LabVIEW as long as I did. Many, (many!) versions ago, the naming of these conversion tools was much more confusing. How would you name them?
06-16-2008 06:48 PM
I have forgotten all about LV5.1... Last time I saw it was in 1999-2000.. 😮