Path: republic.btigate.com!news-xfer.netaxs.com!newshub.northeast.verio.net!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!news-peer.sprintlink.net!news.sprintlink.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!news.iastate.edu!vax1.miu.edu!JHMEYERS
From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: FIXN - Number display modes setter
Date: 3 Jun 1998 08:58:56 GMT
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Lines: 39
Message-ID: <6l338g$q78$1@news.iastate.edu>
References: <6ku5fj$20n5@ayax.uniandes.edu.co>,<6l0479$7a4$3@news.iastate.edu>
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:11447

In article <6ku5fj$20n5@ayax.uniandes.edu.co>,
l-vega@isis.uniandes.edu.co (   Luis Vega) writes:

> If [display] is FIX, let's say 2, it shows like this: 3.851.455,66
> This way, the visualization is more clear, but you don't have the
> precision of the standard mode. So the question is:
> Is there a program that changes visualization (like java),
> that can show you the [always complete] number like 3.851.455,65789
> [but without superfluous trailing zeros -- per private E-mail]

Well, here comes a "second opinion" from the same doctor :)

Below is a simple program which will adjust the current display mode
to display stack level 1 so as to display "thousands separators" and
all significant digits, but no unnecessary trailing zeros following
a "fraction mark" (a/k/a "decimal point"); you may optionally include
a conversion of the item to a string, if you want to use this function
as the basis of a program to display each of several stack levels
at the same time in the same "optimal" format:
 
%%HP: T(3); @ FIXN - automatically choose appropriate N FIX display mode
@ Change current display mode to suit stack level 1.
@ Note that there is no dependence on flag -51 ("fraction mark")
\<< DUP TYPE NOT @ For real argument only
    { DUP STD \->STR "E" POS NOT @ Try STD mode, check for "E"
      { DUP FP ABS \->STR SIZE 1 - DUP FIX @ Use FIX if no "E"
        11 > { STD } IFT @ 12 FIX [acts like 11 FIX] ==> Back to STD
      } IFT @ Trailing zeros are eliminated from decimal part!
    } IFT @ Real argument only
    @ Optionally convert to string via #159EBh SYSEVAL [stkdecomp$w]
\>>

I suppose you could invoke this same function from "Vectored Enter"
programs, in order to continually and automatically update the display
to adjust to the results of a sequence of manual calculations, thus
making the HP48 finally the near equal of any 4-function calculator :)

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>