diff options
author | Robb Matzke <matzke@llnl.gov> | 2000-10-31 18:10:17 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 2000-10-31 18:10:17 (GMT) |
commit | acf6b83365ca5b8c4c8d0d4cce40957737393b49 (patch) | |
tree | bc2e4b6db3f59abd9249c32c8fb8749d1a69bee2 /tools/h5ls.c | |
parent | c5c4b42e79b13b13644c586259a5909e523b226e (diff) | |
download | hdf5-acf6b83365ca5b8c4c8d0d4cce40957737393b49.zip hdf5-acf6b83365ca5b8c4c8d0d4cce40957737393b49.tar.gz hdf5-acf6b83365ca5b8c4c8d0d4cce40957737393b49.tar.bz2 |
[svn-r2776] ./hdf5/tools/h5ls.c
* 2000-10-31 Robb Matzke <matzke@llnl.gov> (dump_dataset_values)
The `float' and `double'
values are displayed with the full precision instead of just the
default `%g'.
Diffstat (limited to 'tools/h5ls.c')
-rw-r--r-- | tools/h5ls.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/h5ls.c b/tools/h5ls.c index fec6394..fa4c738 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -1116,6 +1116,7 @@ dump_dataset_values(hid_t dset) size_t size = H5Tget_size(f_type); h5dump_t info; char string_prefix[64]; + static char fmt_double[16], fmt_float[16]; /* Set to all default values and then override */ memset(&info, 0, sizeof info); @@ -1151,6 +1152,12 @@ dump_dataset_values(hid_t dset) info.str_repeat = 8; } + /* Floating point types should display full precision */ + sprintf(fmt_float, "%%1.%dg", FLT_DIG); + info.fmt_float = fmt_float; + sprintf(fmt_double, "%%1.%dg", DBL_DIG); + info.fmt_double = fmt_double; + info.dset_format = "DSET-%lu:%lu:%lu:%lu-"; info.dset_hidefileno = 0; |