[Thread Prev][Thread Next][Index]

Re: Embedded expressions



Hi Patrick,

Ferret version 5.3 has new format controls "width" (abbreviation "w") and
zero-filled width (abbreviation "zw"):

     yes? say example:`5`
     example:5
     yes? say example:`5,w=5`
     example:    5
     yes? say example:`5,zw=5`
     example:00005

Also, the "precision=" (abbreviation "p") controls significant digits if
positive and decimal places if negative

     yes? say example:`0.5134,zw=6,p=-3`
     example:00.513

Will this do the trick?

    - steve

=============================

Patrick Brockmann wrote:

> Hi Ferreters,
>
> OBJECT: Embedded expression and control of format
>
> Is there a way to control the format of an integer?
>
> At page 96 of the manual, there is the following example:
> say `3/10,precision=7`
> It results 0.3
>
> Could it be possible to have also a control on
> the number of digit as in c.
> Much better thing would be a format control.
>
> say `3/10,format=06.2f`
> could produce
> 000.30
>
> say `5,format=06.0f`
> could produce
> 000005
>
> Beyond this point, I would like to produce
> gif file with ordered name file to be played with
> Xanim for example.
>
> repeat/l=1:300 (shade var; frame/format=gif/file=output_`l,format=04.0f`)
>
> Thanks again for any help or possible upgrade.
>
> Regards
> Patrick
>
> --
> Patrick BROCKMANN (LSCE/CNRS-CEA Saclay)
> Laboratoire des Sciences du Climat et de l'Environnement
> Unite mixte de recherche CNRS-CEA
> L'Orme des Merisiers - Bat.701 - CEA/Saclay
> 91191 GIF sur YVETTE cedex - FRANCE
> Tel : 01 69 08 86 79 - Fax : 01 69 08 77 16
> mailto:brock@lsce.saclay.cea.fr

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement