HP Forums

Full Version: Displaying Fewer Digits in CAS and HOME
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm trying to only show four decimal digits in both matrices in CAS or in the stack in HOME. I can't seem to get any of the settings to do this. Sorry if this has been asked before, but search gave nothing.

C
You'll want the display setting "Rounded 4"
(02-24-2017 05:09 AM)Tim Wessman Wrote: [ -> ]You'll want the display setting "Rounded 4"

Chazzs, please note that the above is in the Home Settings page, not in the CAS Settings page. The "Number Format" setting that you see in the CAS Settings page currently does nothing.
(02-24-2017 05:09 AM)Tim Wessman Wrote: [ -> ]You'll want the display setting "Rounded 4"
How can I set that from an HPPL program? I know I can use the STRING function for individual numbers but I'd like to be able to save the current display mode, set the mode to a new value and restore the original mode when the program ends.

Tom L
Use the HDigits home variable:

HFormat:=1;
HDigits:=4;

Quote:I'd like to be able to save the current display mode, set the mode to a new value and restore the original mode when the program ends.

F:=HFormat; // save the current display mode
HFormat:=1; // set the mode to a new value
H:=HDigits;
HDigits:=4;
HFormat:=F; //restore the original mode when the program ends
(02-24-2017 04:05 PM)toml_12953 Wrote: [ -> ]
(02-24-2017 02:27 PM)DrD Wrote: [ -> ]Use the HDigits home variable:

HFormat:=1;
HDigits:=4;


F:=HFormat; // save the current display mode
HFormat:=1; // set the mode to a new value
H:=HDigits;
HDigits:=4;
HFormat:=F; //restore the original mode when the program ends
Thanks but no matter what I set HDigits to I get the number of decimal places I saved in the Settings screen.
Changing HDigits doesn't change the decimal places for me.

Tom L

I see the change immediately when I type (in either Home or CAS)

HFormat:=1; // display automatically shows fixed format (any pre-existing numbers on the screen changes);
HDigits:=4; // only four digits displayed after fraction mark

Did you make sure that you changed HFormat to 1 (Fixed mode)? Leaving it as 0 won't do anything. HDigits only applies when HFormat specifies a mode that uses fixed digits.
(02-24-2017 04:05 PM)toml_12953 Wrote: [ -> ]Thanks but no matter what I set HDigits to I get the number of decimal places I saved in the Settings screen.
Changing HDigits doesn't change the number of decimal places for me.
Tom L

Take some time to review the parameters associated with HFormat and HDigits. (User Guide, and Help docs on the Home Variables). It will do the things you desire, but your settings need to be appropriate. I have quite a few programs that take advantage of these settings. I also am quite sure they will work for you too.
(02-24-2017 05:09 AM)Tim Wessman Wrote: [ -> ]You'll want the display setting "Rounded 4"

Ah. There it is. Thanks Tim and Joe.

CHUCK
(02-24-2017 04:17 PM)DrD Wrote: [ -> ]
(02-24-2017 04:05 PM)toml_12953 Wrote: [ -> ]Thanks but no matter what I set HDigits to I get the number of decimal places I saved in the Settings screen.
Changing HDigits doesn't change the number of decimal places for me.
Tom L

Take some time to review the parameters associated with HFormat and HDigits. (User Guide, and Help docs on the Home Variables). It will do the things you desire, but your settings need to be appropriate. I have quite a few programs that take advantage of these settings. I also am quite sure they will work for you too.

My bad (of course!) I was missing the colon in the statement

HDigits:=4;

Thanks for your patience!

Tom L
Reference URL's