ref: c893c0b965b5c12bdea1c3e11a7f27b0b459a207
parent: b1e84a59c5c100e9aa5c31eb39d58e174289249d
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Dec 30 07:56:13 EST 2019
use %g instead of %f
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
# the order is: type value initial min max step
# it's different for different UI elements
% cat K*/a/frequency/ctl
-vslider 100.000000 100.000000 10.000000 200.000000 5.000000
+vslider 100 100 10 200 5
# raise frequency to 160Hz
% echo 160 > K*/a/f*/ctl
--- a/uiglue.c
+++ b/uiglue.c
@@ -25,11 +25,11 @@
case UIVGroup: snprint(s, sz, "vgroup\n"); return s;
case UIButton: snprint(s, sz, "button\t%d\n", !!*ui->zone); return s;
case UICheckBox: snprint(s, sz, "checkbox\t%d\n", !!*ui->zone); return s;
- case UIVSlider: snprint(s, sz, "vslider\t%f\t%f\t%f\t%f\t%f\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
- case UIHSlider: snprint(s, sz, "hslider\t%f\t%f\t%f\t%f\t%f\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
- case UINEntry: snprint(s, sz, "nentry\t%f\t%f\t%f\t%f\t%f\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
- case UIHBarGraph: snprint(s, sz, "hbargraph\t%f\t%f\t%f\n", *ui->zone, ui->min, ui->max); return s;
- case UIVBarGraph: snprint(s, sz, "vbargraph\t%f\t%f\t%f\n", *ui->zone, ui->min, ui->max); return s;
+ case UIVSlider: snprint(s, sz, "vslider\t%g\t%g\t%g\t%g\t%g\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
+ case UIHSlider: snprint(s, sz, "hslider\t%g\t%g\t%g\t%g\t%g\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
+ case UINEntry: snprint(s, sz, "nentry\t%g\t%g\t%g\t%g\t%g\n", *ui->zone, ui->init, ui->min, ui->max, ui->step); return s;
+ case UIHBarGraph: snprint(s, sz, "hbargraph\t%g\t%g\t%g\n", *ui->zone, ui->min, ui->max); return s;
+ case UIVBarGraph: snprint(s, sz, "vbargraph\t%g\t%g\t%g\n", *ui->zone, ui->min, ui->max); return s;
default: sysfatal("unknown ui type %d", a->type);
}
} else if (type == Xuimeta) {