aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ldp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-04-25 06:34:42 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-04-25 06:34:42 +0000
commit40372926f01134350b23039fc3f2c79b23d93740 (patch)
tree7eec1a1901f90288559f3ae6e4888ccf91ae9720 /packet-ldp.c
parentbbf665269e61f4975eaecaa6227c2787b33ad3fe (diff)
Use "%.10g", rather than "%f", for floating-point numbers. That will
display values that would fit in a 32-bit integer as integers, leaving out all trailing zeroes after the decimal point (and leaving out the decimal point if there are no digits left after the decimal point once trailing zeroes are removed), and will use scientific notation for small fractions or large numbers. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5248 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ldp.c')
-rw-r--r--packet-ldp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-ldp.c b/packet-ldp.c
index 21e2e04789..e0486c9c35 100644
--- a/packet-ldp.c
+++ b/packet-ldp.c
@@ -1,7 +1,7 @@
/* packet-ldp.c
* Routines for LDP (RFC 3036) packet disassembly
*
- * $Id: packet-ldp.c,v 1.35 2002/04/24 19:35:52 guy Exp $
+ * $Id: packet-ldp.c,v 1.36 2002/04/25 06:34:41 guy Exp $
*
* Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
@@ -1447,30 +1447,30 @@ dissect_tlv_traffic(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
/* PDR */
val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pdr, tvb, offset,
- 4, val_f, "PDR: %f Bps", val_f);
+ 4, val_f, "PDR: %.10g Bps", val_f);
offset += 4;
/* PBS */
val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pbs, tvb, offset,
- 4, val_f, "PBS: %f Bytes", val_f);
+ 4, val_f, "PBS: %.10g Bytes", val_f);
offset += 4;
/* CDR */
val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cdr, tvb, offset,
- 4, val_f, "CDR: %f Bps", val_f);
+ 4, val_f, "CDR: %.10g Bps", val_f);
offset += 4;
/* CBS */
val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cbs, tvb, offset,
- 4, val_f, "CBS: %f Bytes", val_f);
+ 4, val_f, "CBS: %.10g Bytes", val_f);
offset += 4;
/* EBS */
val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_ebs, tvb, offset,
- 4, val_f, "EBS: %f Bytes", val_f);
+ 4, val_f, "EBS: %.10g Bytes", val_f);
}
}