From 5f8eb30ce00ced83e78af7c2b62829cc5baa204c Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 6 Oct 2024 17:45:50 -0700 Subject: [PATCH] Format dumped sound alias float values --- src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp index 67a041f4..bf3d6f13 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp @@ -399,20 +399,20 @@ namespace { const auto linear = static_cast(value) / static_cast(std::numeric_limits::max()); const auto dbSpl = std::clamp(LinearToDbspl(linear), 0.0f, 100.0f); - stream.WriteColumn(std::format("{:.3g}", dbSpl)); + stream.WriteColumn(std::format("{}", std::stof(std::format("{:.0f}", dbSpl)))); } void WriteColumnPitchHertz(CsvOutputStream& stream, const uint16_t value) { const auto hertz = static_cast(value) / static_cast(std::numeric_limits::max()); const auto cents = std::clamp(HertzToCents(hertz), -2400.0f, 1200.0f); - stream.WriteColumn(std::format("{:.4g}", cents)); + stream.WriteColumn(std::format("{}", std::stof(std::format("{:.0f}", cents)))); } void WriteColumnNormByte(CsvOutputStream& stream, const uint8_t value) { const auto normValue = static_cast(value) / static_cast(std::numeric_limits::max()); - stream.WriteColumn(std::format("{:.3g}", normValue)); + stream.WriteColumn(std::format("{}", std::stof(std::format("{:.2f}", normValue)))); } void WriteColumnWithKnownHashes(CsvOutputStream& stream, const std::unordered_map& knownValues, const unsigned value)