Clean up some float formatting.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 1 Nov 2004 07:51:33 +0000 (07:51 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 1 Nov 2004 07:51:33 +0000 (07:51 +0000)
battle.c
events.c
planets.c
reports.c
sst.c

index 7abe93a4d1662836efedec438ac1bf0d14e7f913..5a29bb8ea4f16545d75cb3c54a331f68eee4ba13 100644 (file)
--- a/battle.c
+++ b/battle.c
@@ -953,7 +953,7 @@ void phasers(void) {
                                key = scan();\r
                        }\r
                        if (key != IHREAL && nenhere != 0) {\r
-                               prout("Phasers locked on target. Energy available = %3.2f", ifast?energy-200.0:energy);\r
+                               prout("Phasers locked on target. Energy available = %.2f", ifast?energy-200.0:energy);\r
                        }\r
                        do {\r
                                while (key != IHREAL) {\r
@@ -963,7 +963,7 @@ void phasers(void) {
                                }\r
                                rpow = aaitem;\r
                                if (rpow >= (ifast?energy-200:energy)) {\r
-                                   proutn("Energy available= %3.2f",\r
+                                   proutn("Energy available= %.2f",\r
                                        ifast?energy-200:energy);\r
                                        skip(1);\r
                                        key = IHEOL;\r
@@ -1034,7 +1034,7 @@ void phasers(void) {
                                int ii = game.kx[k], jj = game.ky[k];\r
                                int ienm = game.quad[ii][jj];\r
                                if (msgflag) {\r
-                                       proutn("Energy available= %5.2f",\r
+                                       proutn("Energy available= %.2f",\r
                                               energy-.006-(ifast?200:0));\r
                                        skip(1);\r
                                        msgflag = 0;\r
index ec3902e2ee71933438b30293e2056753f7fa818e..c3f22f5d0996b7d0b1d43384c4471e6fba3dbb6e 100644 (file)
--- a/events.c
+++ b/events.c
@@ -634,7 +634,7 @@ void snova(int insx, int insy) {
                        /* it isn't here, or we just entered (treat as inroute) */\r
                        if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
                                skip(1);\r
-                               prout("Message from Starfleet Command       Stardate %5.2f", game.state.date);\r
+                               prout("Message from Starfleet Command       Stardate %.2f", game.state.date);\r
                                proutn("     Supernova in %s; caution advised.",\r
                                       cramlc(quadrant, nqx, nqy));\r
                        }\r
index aa2982554fb3a445605404c272bfe356b812540e..a45879f05c8adf225ea236fec6150810117b8eb2 100644 (file)
--- a/planets.c
+++ b/planets.c
@@ -79,7 +79,7 @@ void orbit(void) {
        newcnd();\r
        if (consumeTime()) return;\r
        height = (1400.+7200.*Rand());\r
-       prout("Sulu-  \"Entered orbit at altitude %4.2f kilometers.\"", height);\r
+       prout("Sulu-  \"Entered orbit at altitude %.2f kilometers.\"", height);\r
        inorbit = 1;\r
        return;\r
 }\r
index e847f8340a430815524ef8777d7e73083764352e..858c70cb479f66689b0b5b3ff3a3fda391658fa2 100644 (file)
--- a/reports.c
+++ b/reports.c
@@ -290,7 +290,7 @@ void srscan(int l) {
                                                if (condit == IHDOCKED)\r
                                                        proutn("DAMAGED, supported by starbase");\r
                                                else\r
-                                                       proutn("DAMAGED, reserves=%4.2f", lsupres);\r
+                                                       proutn("DAMAGED, reserves=%.2f", lsupres);\r
                                        }\r
                                        else\r
                                                proutn("ACTIVE");\r
@@ -438,16 +438,16 @@ void eta(void) {
                }\r
                else\r
                        proutn("Remaining");\r
-               prout(" energy will be %5.2f.", energy-tpower);\r
+               prout(" energy will be %.2f.", energy-tpower);\r
                if (wfl) {\r
-                       prout("And we will arrive at stardate %5.2f.",\r
+                       prout("And we will arrive at stardate %.2f.",\r
                                game.state.date+ttime);\r
                }\r
                else if (twarp==1.0)\r
                        prout("Any warp speed is adequate.");\r
                else {\r
-                       prout("Minimum warp needed is %5.2f,", twarp);\r
-                       prout("and we will arrive at stardate %5.2f.",\r
+                       prout("Minimum warp needed is %.2f,", twarp);\r
+                       prout("and we will arrive at stardate %.2f.",\r
                                game.state.date+ttime);\r
                }\r
                if (game.state.remtime < ttime)\r
diff --git a/sst.c b/sst.c
index 653e06be826b8a71d4950682fa2ad04fb78f1267..2ef4261a62f2183f1c05532379de791cd272fc8a 100644 (file)
--- a/sst.c
+++ b/sst.c
@@ -677,7 +677,7 @@ void debugme(void) {
                                case FSCMOVE: proutn("SC Move         "); break;\r
                                case FSCDBAS: proutn("SC Base Destroy "); break;\r
                        }\r
-                       proutn("%82.2f", future[i]-game.state.date);\r
+                       proutn("%.2f", future[i]-game.state.date);\r
                        chew();\r
                        proutn("  ?");\r
                        key = scan();\r