This commit is contained in:
Aleksander Kosarskii 2024-11-01 13:04:55 +01:00 committed by GitHub
commit 39ba0b111b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
build/
/tags
/bazel-*
cmake-build-debug/
.idea/

View File

@ -14,6 +14,7 @@
#include <sstream>
#include <string>
#include <type_traits>
#include <iomanip>
#include "yaml-cpp/binary.h"
#include "yaml-cpp/dll.h"
@ -179,7 +180,9 @@ inline Emitter& Emitter::WriteStreamable(T value) {
}
}
if (!special) {
if (static_cast<float>(static_cast<int>(value)) == value){
stream << std::fixed << std::setprecision(1) << value;
}else if (!special) {
stream << value;
}
m_stream << stream.str();