Small decimals: implement printBoatValue() function for flexible decimals font size of boat values; still some bugs

This commit is contained in:
Ulrich Meine
2026-08-24 23:09:19 +02:00
parent fecb9a8043
commit 99f88cca3f
7 changed files with 211 additions and 96 deletions
+4 -7
View File
@@ -96,20 +96,17 @@ FormattedData formatValue(GwApi::BoatValue *value, CommonData &commondata, bool
double limit_dec_10;
double limit_dec_100;
if (precision == "1") {
//
//All values are displayed using a DSEG7* font. In this font, ' ' is a very short space, and '.' takes up no space at all.
//For a space that is as long as a number, '!' is used. For details see https://www.keshikan.net/fonts-e.html
//
//All values are displayed using a DSEG7* font. In this font, ' ' is a very short space, and '.' takes up no space at all.
//For a space that is as long as a number, '!' is used. For details see https://www.keshikan.net/fonts-e.html
fmt_dec_1 = "!%1.1f"; // blank digit + 2 digit number, incl. 1 decimal
// fmt_dec_10 = "!%2.0f"; //insert a blank digit and then display a two-digit number
fmt_dec_10 = "%3.1f"; // 3 digit number, incl. 1 decimal
fmt_dec_100 = "%3.0f"; // 3 digit number, no decimal
limit_dec_10=9.95; // use fmt_dec_1 below this number to avoid formatting 9.96 as 10.0 instead of 10
limit_dec_100=99.5;
} else {
fmt_dec_1 = "%3.2f";
// fmt_dec_10 = "%3.1f";
fmt_dec_10 = "%3.2f"; // test for small decimals
fmt_dec_10 = "%3.1f";
fmt_dec_100 = "%3.0f";
limit_dec_10=9.995;
limit_dec_100=99.95;