summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-28 00:16:08 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-28 00:16:08 +0000
commit465d6f914af6cf258bad5c70498eaadb2262c732 (patch)
treeae65ac47b441521a3aefba0ba14862512b087fee /src
parentc9c0c7a2985240d1fb1105e7bf3e4bdfb42286dd (diff)
OK, I *definitely* need a remedial math class...
Now compute number of digits required using B / A, and then looping. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2264 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Valuator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Valuator.cxx b/src/Fl_Valuator.cxx
index 081ba056e..f2b365505 100644
--- a/src/Fl_Valuator.cxx
+++ b/src/Fl_Valuator.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.3 2002/05/28 00:12:49 easysw Exp $"
+// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.4 2002/05/28 00:16:08 easysw Exp $"
//
// Valuator widget for the Fast Light Tool Kit (FLTK).
//
@@ -117,11 +117,11 @@ int Fl_Valuator::format(char* buffer) {
double v = value();
if (!A) return sprintf(buffer, "%g", v);
int i, x;
- double ab = A * B;
- for (x = 1, i = 0; x < ab; x *= 10) i++;
+ double ba = B / A;
+ for (x = 1, i = 0; x < ba; x *= 10) i++;
return sprintf(buffer, "%.*f", i, v);
}
//
-// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.3 2002/05/28 00:12:49 easysw Exp $".
+// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.4 2002/05/28 00:16:08 easysw Exp $".
//