summaryrefslogtreecommitdiff
path: root/libntp/fptoms.c
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
committerOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
commitcce65f439697627afbccf5a67035a957bb4d784a (patch)
tree16d100fbc9dae63888d48b464e471ba0e5065193 /libntp/fptoms.c
parent8c24a1e0ffd629427f94da1b681600008030c41a (diff)
Notes
Diffstat (limited to 'libntp/fptoms.c')
-rw-r--r--libntp/fptoms.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libntp/fptoms.c b/libntp/fptoms.c
new file mode 100644
index 000000000000..0bfca5556160
--- /dev/null
+++ b/libntp/fptoms.c
@@ -0,0 +1,24 @@
+/*
+ * fptoms - return an asciized s_fp number in milliseconds
+ */
+#include "ntp_fp.h"
+
+char *
+fptoms(
+ s_fp fpv,
+ short ndec
+ )
+{
+ u_fp plusfp;
+ int neg;
+
+ if (fpv < 0) {
+ plusfp = (u_fp)(-fpv);
+ neg = 1;
+ } else {
+ plusfp = (u_fp)fpv;
+ neg = 0;
+ }
+
+ return dofptoa(plusfp, neg, ndec, 1);
+}