SteveMyres Posted December 6, 2011 Share Posted December 6, 2011 Many engineering units are customarily placed immediately after the number without a space, for example the inch mark for either pressure or length, ft, degree mark for temperature, etc., and look odd if there is a space between the value and the unit. If you stop adding a space to whatever is entered in the units box for display, then in those cases where it's needed, it can be added, but then we'd have the option not to have it. Link to comment Share on other sites More sharing options...
AzeoTech Posted December 7, 2011 Share Posted December 7, 2011 You can do it now using Format() and not specifying units or caption. For example: Format("My value: %.3fUnits", myChannel[0]) Unfortunately, if we made every possible combination an option in the properties it would be completely unwieldy. That's why we have scripting. We make the most common functionality available through properties and then give a powerful scripting option for anything less common. Link to comment Share on other sites More sharing options...
SteveMyres Posted December 8, 2011 Author Share Posted December 8, 2011 I wasn't saying be all things to all people, I was saying remove the extra space for everybody, and the people who want it can put it back in as part of the units string (whereas I can't take out one that isn't there). Nevertheless, the Format() solution is adequate. Link to comment Share on other sites More sharing options...
AzeoTech Posted December 8, 2011 Share Posted December 8, 2011 True, but: 1-The most common use is with a space (you are the first to mention a need to not have it in 10 years) 2-If we change it now, it will cause all the existing apps to be misformatted. (I'm not trying to put down your suggestion in any way, simply tell you why its not going to change in this case) Link to comment Share on other sites More sharing options...
SteveMyres Posted December 10, 2011 Author Share Posted December 10, 2011 The most common use FOR MOST units is with a space. You'll never see a space between a number and an inch mark for example. Nevertheless, at least there's a workaround, so it's all good. Link to comment Share on other sites More sharing options...
SteveMyres Posted October 30, 2012 Author Share Posted October 30, 2012 The degree symbol (usually for temperature but in this case for angle) is one where I'd REALLY like to lose the extra space, so I tried Format("%0.2f°", N7040[0] / 100.0) but without success. It strips the degree symbol and just prints the value to 2 places. So I tried DoubleToStr(N7040[0] / 100.0) + "°" but that does exactly the same thing (prints the string and omits the symbol). Link to comment Share on other sites More sharing options...
SteveMyres Posted November 2, 2012 Author Share Posted November 2, 2012 Any suggestions? Well, other than "Stop worrying about trivial crap and get back to work!" Link to comment Share on other sites More sharing options...
AzeoTech Posted November 2, 2012 Share Posted November 2, 2012 I wasn't going to say it... Sure: the issue appears to actually be in the script parser. It doesn't like the "°", probably because its an extended character and the script parser really only looks at standard ASCII. So, what you do is create a static text component somewhere hidden (set visibility to 0, or put it on a scratch page or something). Give it a name, like "degreeChar", then you can pull in the degree character by accessing the strText member of that component. So, your expression becomes: DoubleToStr(N7040[0] / 100.0) + component.degreeChar.strText A little roundabout, but works. You could make it cleaner by setting a global variable in startup to that char: global string degreeChar = component.degreeChar.strText then use degreeChar in any expression you want to use it. Note that it won't work in non-expression fields, but those should support the character directly anyway. Link to comment Share on other sites More sharing options...
SteveMyres Posted November 2, 2012 Author Share Posted November 2, 2012 Thanks! That should do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.