Re: Any suggestion for code to format REAL in a narrow column?



On Feb 14, 4:46 am, "n...@xxxxxxxxxxxxxxx" <n...@xxxxxxxxxxxxxxx>
wrote:
....
In writing F.77 (eg. VAX-Fortran), I'd like to output a REAL*4 value
into a column of 6 characters width.
I also have a supplied INTEGER value ("decno") that states "the
number of decimals", eg it is ment to be formatted like F6.<decno>,
but as You guess there might be a problem. For example, for decno=3,
the output is only fine when -10 < value < 100.

In the general case, this holds, but... when something goes out of the
normal, I'd prefere to squece the value in anyhow! First, I'm
reducing on the number of decimals used, secondly, I'm reverting to
using exponential form.
....
As I'd like to maximize the number of valid figures presented anyhow,
I'd like to note that:

123E11 Has more information than 1.2E13
....

In the Bettis Labs-written nuclear design codes of ages gone by, there
was an input/output processor that made the tacit assumption all
floating point values were written as (for example) 123456-3 where the
decimal and E were implied. The decimal was implied as leading so the
example is 0.000123456. It also had the ability to parse input
containing properly specified I,E, or F formatted values, but I gather
only output is significant here.

I think this is about the most concise generic format possible once
one selects a field width. Switching around between formats from entry
to entry makes reading the output very painful and error prone so
perhaps the occasional loss of a character of precision might be made
up for by fewer mistaken interpretations?

Whether these routines are available or not I don't know--I never saw
the source, but had the functionality available as linkable modules on
machines of days of yore...I know most if not all the codes have been
ported to desktops, but I've not used one in more years than I care to
remember... :)

Anyway, hopefully at least the idea is of some help...
--

.



Relevant Pages

  • Re: Any suggestion for code to format REAL in a narrow column?
    ... into a column of 6 characters width. ... number of decimals", eg it is ment to be formatted like F6., ... the base or the exponent is positive, there is no need to waste space ... you will require the same FORMAT for the entire column. ...
    (comp.lang.fortran)
  • Re: Format issue ... 2 decimal places displayed?
    ... --in the format property delete everything ... Jeanette Cunningham wrote: ... to get sql of your query, open the query in design view, then select ... release the cursor and the 2008 ('without decimals') shows up in the ...
    (microsoft.public.access.forms)
  • Re: Format issue ... 2 decimal places displayed?
    ... Jeanette Cunningham wrote: ... I've finally been able to reproduce that format with 2 decimal places in a combo on the form. ... to get sql of your query, open the query in design view, then select Query | SQL view from the menu. ... release the cursor and the 2008 ('without decimals') shows up in the text ...
    (microsoft.public.access.forms)
  • Re: SUMPRODUCT formula using hours:minutes
    ... These are numbers with decimals. ... which is used to separate hours from minutes in an Excel time format. ... or can I fix it all on the payroll sheet with the macro? ...
    (microsoft.public.excel.misc)
  • Re: Page totals error in report - doesnt add correctly
    ... Thanks Marshall - it works fine now using CDblwhen I set the format ... display it on a form or report. ... and restrict the value to 2 decimals). ... All Totals text boxes properties are set to General number with 2 decimal ...
    (microsoft.public.access.reports)