23 lines
540 B
C++
23 lines
540 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;
|
|
|
|
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);
|
|
};
|
|
} |