Request for help on math_format function

Robert F Esswein esswein at CLIO.ARC.NASA.GOV
Tue Jan 15 16:59:23 EST 2008


Dear Grads users -

The "math_format" function is not working for me the way I expect (and want) it
to. For example, I expect math_format("%02.2d",5) to be "05".
But Grads is giving me "00".
Is there any way I can get this to work the same as C printf, etc.

A test script:

num = 5
say 'math_format("%02.2d",' num ') = ' math_format("%02.2d",num)
quit

Here is the output from Grads (some lines deleted):

c 217% grads -clb 'run fmttest'
Grid Analysis and Display System (GrADS) Version 1.9b4
Config: v1.9b4 32-bit little-endian readline sdf/xdf hdf-sds netcdf lats printim
Running in Batch mode
math_format("%02.2d",5) = 00

My system is
Linux c.arc.nasa.gov 2.6.20-2936.fc7xen #1 SMP Fri Sep 21 11:56:20 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
Fedora release 7 (Moonshine)

Grads was installed from grads-bin-1.9b4-linuxRHE3.tar.gz

Thanks,
Bob



More information about the gradsusr mailing list