The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime: Converting number to Sci notation and back
Message #1 Posted by BruceTTT on 11 Nov 2013, 8:01 p.m.

Is there a simple way to convert a floating point to scientific notation and the reverse as well? (IOW a sic notation method like the a b/c button).

      
Re: HP Prime: Converting number to Sci notation and back
Message #2 Posted by Phil Wipf on 12 Nov 2013, 2:11 a.m.,
in response to message #1 by BruceTTT

One method, maybe not what you are looking for, is make a user key program to change the global HFormat setting. Whatever key you pick (in this case EEX) will cycle through the formats, you could easily make it cycle through only the formats you want. It updates any numbers on the stack/history as well. The STARTVIEW lines are just a way to get the screen to update, RETURN 5 returns a HOME key press which is the way I have found to "not do anything extra". The only problem I know with this method is it will take you to the home screen as it switches modes. Also some keys don't let you re-assign them.

KEY K_Eex()
BEGIN
  HFormat:=(HFormat+1) MOD 4;
  STARTVIEW(-8,0);
  STARTVIEW(-1,1);
  RETURN 5;
END;

or an alternative

KEY K_Eex()
BEGIN
  IF HFormat == 0 THEN
    HFormat := 2;
  ELSE
    HFormat := 0;
  END;
  STARTVIEW(-8,0);
  STARTVIEW(-1,1);
  RETURN 5;
END;

(To make a User Key just put those lines in any program listing, substitute for K_Eex the key you want to use, and then SHIFT->Help(User) + EEX) (Or lock User keys with SHIFT->Help(User) twice)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall