Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ using std::use_facet;
namespace detail {
struct locale {};
template <typename Char> struct numpunct {
auto grouping() const -> std::string { return "\03"; }
auto grouping() const -> std::string { return {}; }
auto thousands_sep() const -> Char { return ','; }
auto decimal_point() const -> Char { return '.'; }
};
Expand Down
3 changes: 2 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ if (FMT_PEDANTIC)
endif ()

# Test that the library compiles without locale.
add_library(nolocale-test ../src/format.cc)
add_executable(nolocale-test ../src/format.cc nolocale-test.cc)
target_include_directories(nolocale-test
PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_compile_definitions(nolocale-test PRIVATE FMT_USE_LOCALE=0)
target_compile_options(nolocale-test
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
add_test(NAME nolocale-test COMMAND nolocale-test)
endif ()

# These tests are disabled on Windows because they take too long.
Expand Down
13 changes: 13 additions & 0 deletions test/nolocale-test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Formatting library for C++ - no-locale tests
//
// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
// All rights reserved.
//
// For the license information refer to format.h.

#include "fmt/format.h"

int main() {
if (fmt::format("{:L}", 1234567) != "1234567") return 1;
if (fmt::format("{:L}", 1234.5) != "1234.5") return 1;
}
Loading