[ncl-talk] How to print zero before the decimal point with "write_matrix" function

Wan Jianghua wanjianghua at mail.iap.ac.cn
Thu Sep 12 02:32:42 MDT 2019


Hi all,

I try to print a nicely formatted text file with "write_matrix" function,
but the result is not satisfactory.

When the absolute value of the number is less than 1, the zero before the
decimal point is omitted. Is there any possible way to print it out? Thanks!

 

My test script:

a=new((/2,2/),float,-999.)

a=0.1

a(0,0)=-0.1

write_matrix(a,"2f5.2",True)

 

the result:

-.10   .10

.10   .10



 

Sincerely,

Jianghua

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190912/bc22cc52/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2833 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190912/bc22cc52/attachment.png>


More information about the ncl-talk mailing list