Commit 81327b46 authored by Victor Yacovlev's avatar Victor Yacovlev

WIN32: expform real values printing looks like in POSIX

parent 755445ef
...@@ -869,6 +869,21 @@ public: ...@@ -869,6 +869,21 @@ public:
sprintf(buffer, Coder::encode(ASCII, sprintfFormat).c_str(), value); sprintf(buffer, Coder::encode(ASCII, sprintfFormat).c_str(), value);
std::string result(reinterpret_cast<char*>(&buffer)); std::string result(reinterpret_cast<char*>(&buffer));
int epos = result.find('e');
if (epos!=std::string::npos) {
std::string beforeESignValue = result.substr(0,epos+2);
std::string afterESignValue = result.substr(epos+2);
while (afterESignValue.length()>0 && afterESignValue.at(0)=='0') {
afterESignValue = afterESignValue.substr(1);
}
result = beforeESignValue;
int zeroesToAppend = 2-afterESignValue.length();
for (int i=0; i<zeroesToAppend; i++) {
result.push_back('0');
}
result += afterESignValue;
}
if (width>0) { if (width>0) {
int leftSpaces = 0; int leftSpaces = 0;
int rightSpaces = 0; int rightSpaces = 0;
......
...@@ -34,7 +34,7 @@ int usage(const char * programName) ...@@ -34,7 +34,7 @@ int usage(const char * programName)
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\t-ansi\t\tИспользовть кодировку 1251 вместо 866 в терминале (только для Windows)"); message += Core::fromUtf8("\t-ansi\t\tИспользовть кодировку 1251 вместо 866 в терминале (только для Windows)");
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\tИМЯФАЙЛА.kod\tИмя выполнеяемой программы)"); message += Core::fromUtf8("\tИМЯФАЙЛА.kod\tИмя выполнеяемой программы");
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\tПАРАМ1...ПАРАМn\tАргументы главного алгоритма Кумир-программы"); message += Core::fromUtf8("\tПАРАМ1...ПАРАМn\tАргументы главного алгоритма Кумир-программы");
message.push_back(_n); message.push_back(_n);
...@@ -48,7 +48,7 @@ int usage(const char * programName) ...@@ -48,7 +48,7 @@ int usage(const char * programName)
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\t-ansi\t\tUse codepage 1251 instead of 866 in console (Windows only)"); message += Core::fromUtf8("\t-ansi\t\tUse codepage 1251 instead of 866 in console (Windows only)");
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\tFILENAME.kod\tKumir runtime file name)"); message += Core::fromUtf8("\tFILENAME.kod\tKumir runtime file name");
message.push_back(_n); message.push_back(_n);
message += Core::fromUtf8("\tARG1...ARGn\tKumir program main algorithm arguments"); message += Core::fromUtf8("\tARG1...ARGn\tKumir program main algorithm arguments");
message.push_back(_n); message.push_back(_n);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment