Files
OpenVulkano/openVulkanoCpp/Base/UnitFormatter.hpp
2024-09-20 12:44:01 +03:00

24 lines
606 B
C++

/*
* 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 <units.h>
#include <string>
namespace OpenVulkano
{
class UnitFormatter
{
bool metric = true;
int precision = 3;
bool trimTrailingZeros = true;
public:
UnitFormatter(bool useMetric = true, int precisionDigits = 3, bool doTrimTrailingZeros = true);
std::string Format(units::length::meter_t distance);
std::string Format(units::area::square_meter_t area);
};
}