UnitFormatter class + several tests

This commit is contained in:
Vladyslav Baranovskyi
2024-09-19 16:26:42 +03:00
parent 6ce56b9a00
commit 350df1dc2f
3 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/*
* 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;
public:
UnitFormatter(bool useMetric = true, int precisionDigits = 3);
std::string Format(units::length::meter_t distance);
std::string Format(units::area::square_meter_t area);
};
}