UnitFormatter class + several tests
This commit is contained in:
23
openVulkanoCpp/Base/UnitFormatter.hpp
Normal file
23
openVulkanoCpp/Base/UnitFormatter.hpp
Normal 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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user