Post Reply 
ROUND instruction not working as expected
05-03-2016, 02:37 PM
Post: #14
RE: ROUND instruction not working as expected
(05-03-2016 01:29 AM)Bob Frazee Wrote:  QmFlow1:=ROUND(QmFlow1,0);
My calculator is set to fix 4 (Number Format: in the Home settings).

Understood - you have now rounded to "123" internally on the number. That number displays using your system settings.

Quote:if QmFlow1's value was 123.4567, in v8151 it displayed as 123. In v10077 it displays as 123.0000.

Correct, INPUT follows the system display completely now. It did before - but incorrectly not for first display in the box. It behaves the way everything else in the system does now. Your system settings dictate how the numbers will be shown.

Quote: settings (or I interpret it as 123.0000).

It would be 123.4567 - you are in FIX 4. Hence no rounding actually would happen.

Quote: If optional places is given, ROUND(QmFlow1,0), rounds value to 0 decimal places (which I interpret should display the value as 123 or 123.).

It changes the internal number itself - not display. Display is completely separate from the internal digits in the number.

Quote: The example given in the help file, appears to bear that assumption out. It doesn't appear that Number Format: has any bearing on how QmFlow1 is displayed, at least per the example.

I'll look if I can think of a way to improve the ROUND help. What we are really trying to show there is that your number value changed. However, if you are set in FIX 4 for example, all the results shown in the help files for every example will be "wrong" because they will show using your system settings.


INPUT displays using your system format. I can possibly add a sentence about this in the help, but it seems to me like something that is simply expected since the rest of the system has ALWAYS behaved that way. INPUT was just brought into compliance for that first display.

If you'd like a number to be displayed in a specific way in the INPUT form, you could either convert the number to a string variable before the INPUT or set your display settings before the INPUT form, and then restore them after.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: ROUND instruction not working as expected - Tim Wessman - 05-03-2016 02:37 PM



User(s) browsing this thread: 1 Guest(s)