/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include #include namespace OpenVulkano { class UnitFormatter { bool metric = true; int precision = 3; bool trimTrailingZeros = true; public: UnitFormatter(bool useMetric = true, int precisionDigits = 3, bool doTrimTrailingZeros = true); [[nodiscard]] std::string Format(units::length::meter_t distance) const; [[nodiscard]] std::string Format(units::area::square_meter_t area) const; }; }