1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-04-29 20:11:23 +00:00

fixed saving floats on Windows, key conflict on 's'

This commit is contained in:
Zeno Rogue
2017-10-27 20:08:48 +02:00
parent 1440419dab
commit ab6334974e
2 changed files with 11 additions and 5 deletions

View File

@@ -25,7 +25,8 @@ string fts4(float x) { char buf[64]; sprintf(buf, "%6.4f", x); return buf; }
string ftssmart(ld x) {
if(x == int(x)) return its(int(x));
if(abs(x) > 1) return fts4(x);
char buf[64]; sprintf(buf, "%.10le", (double) x); return buf;
char buf[64]; sprintf(buf, "%.10e", (float) x);
return buf;
}
string cts(char c) { char buf[8]; buf[0] = c; buf[1] = 0; return buf; }