Fix NCF-339, ncdump -x omits exponent char in XML double attribute value

This commit is contained in:
Russ Rew 2015-08-02 08:54:29 -06:00
parent 58573722b6
commit 3d5be0b3f0
3 changed files with 5 additions and 1 deletions

View File

@ -1081,7 +1081,7 @@ pr_attx(
default:
att.vals = (double *) emalloc((att.len + 1) * sizeof(double));
NC_CHECK( nc_get_att_double(ncid, varid, att.name, att.vals ) );
attvalslen = 20*att.len; /* max 20 chars for each value and blank separator */
attvalslen = PRIM_LEN * att.len; /* max chars for each value and blank separator */
attvals = (char *) emalloc(attvalslen + 1);
pr_att_valsx(att.type, att.len, att.vals, attvals, attvalslen);
free(att.vals);

View File

@ -4,8 +4,10 @@
<dimension name="t" length="0" isUnlimited="true" />
<attribute name="gtatt" value="&lt;, &gt;, ', &quot;, and &amp;" />
<attribute name="gnatt" type="int" value="3 4" />
<attribute name="gdatt" type="double" value="-7.02788826649782e-09 7.02788826649782e-09" />
<variable name="var" shape="t m" type="float">
<attribute name="tatt" value="text attribute value" />
<attribute name="natt" type="int" value="1 2" />
<attribute name="datt" type="double" value="7.02788826649782e-09 -7.02788826649782e-09" />
</variable>
</netcdf>

View File

@ -6,6 +6,8 @@ variables:
float var (t, m);
var:tatt = "text attribute value" ;
var:natt = 1, 2;
var:datt = 7.02788826649782e-09, -7.02788826649782e-09 ;
:gtatt = "<, >, \', \", and &" ;
:gnatt = 3, 4;
:gdatt = -7.02788826649782e-09, 7.02788826649782e-09 ;
}