summaryrefslogtreecommitdiff
path: root/src/common/conversion.hpp
blob: e87adc5922d9f59fead569ed5afcc8fa4e579e41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "common/memory/unique_ptr.hpp"
#include "common/string.hpp"

namespace common
{

/**
 * Converts a double number to a string.
 *
 * @param num A double number
 * @param width The desired double width
 * @param precision The desired double precision
 * @returns The double as a string.
 */
common::UniquePtr<common::String> doubleToStr(double num, unsigned int width = 3,
											  unsigned int precision = 2);

/**
 * Converts a integer to a string.
 *
 * @param num A number
 * @returns The number as a string.
 */
common::UniquePtr<common::String> intToStr(int num);

/**
 * Converts a unsigned integer to a string.
 *
 * @param num A number
 * @returns The number as a string.
 */
common::UniquePtr<common::String> uintToStr(unsigned int num);

} // namespace common