From 34bb63ded62a060203d59f8101be6555095e289f Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Wed, 4 Sep 2013 11:25:50 +0200 Subject: [PATCH] bug export nastran file --- include/Algo/Export/exportVol.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/Algo/Export/exportVol.hpp b/include/Algo/Export/exportVol.hpp index c348a10e..bf099fb0 100644 --- a/include/Algo/Export/exportVol.hpp +++ b/include/Algo/Export/exportVol.hpp @@ -46,6 +46,15 @@ inline std::string truncFloatTO8(float f) std::stringstream ss; ss << f; std::string res = ss.str(); + + size_t expo = res.find('e'); + if (expo != std::string::npos) + { + if ( res[expo+2] == '0') + return res.substr(0,6) + res[expo+1] + res[expo+3]; + + return res.substr(0,5) + res.substr(expo+1); + } return res.substr(0,8); } -- GitLab