summaryrefslogtreecommitdiffstats
path: root/tools/h5ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5ls.c')
-rw-r--r--tools/h5ls.c7
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;