MCPcopy Create free account
hub / github.com/comaps/comaps / MakeDistanceStr

Function MakeDistanceStr

libs/platform/platform_tests/distance_tests.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace platform
11{
12std::string MakeDistanceStr(std::string value, Distance::Units unit)
13{
14 static Locale const loc = GetCurrentLocale();
15
16 constexpr char kHardCodedGroupingSeparator = ',';
17 if (auto found = value.find(kHardCodedGroupingSeparator); found != std::string::npos)
18 value.replace(found, 1, loc.m_groupingSeparator);
19
20 constexpr char kHardCodedDecimalSeparator = '.';
21 if (auto found = value.find(kHardCodedDecimalSeparator); found != std::string::npos)
22 value.replace(found, 1, loc.m_decimalSeparator);
23
24 return value.append(kNarrowNonBreakingSpace).append(DebugPrint(unit));
25}
26
27struct ScopedSettings
28{

Callers 1

UNIT_TESTFunction · 0.85

Calls 4

DebugPrintFunction · 0.70
GetCurrentLocaleFunction · 0.50
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected