Fix locale-dependent float printing in GGUF metadata (#17331)

* Set C locale for consistent float formatting across all binaries.

* Add C locale setting to all tools binaries

Add std::setlocale(LC_NUMERIC, "C") to all 16 binaries in the tools/
directory to ensure consistent floating-point formatting.

* Apply suggestion from @JohannesGaessler

---------

Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
This commit is contained in:
SamareshSingh 2026-03-04 02:30:40 -06:00 committed by GitHub
parent 54910bd4f3
commit cb8f4fa3f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 140 additions and 19 deletions

View file

@ -8,6 +8,7 @@
#include "log.h"
#include <atomic>
#include <clocale>
#include <exception>
#include <signal.h>
#include <thread> // for std::thread::hardware_concurrency
@ -67,6 +68,8 @@ static server_http_context::handler_t ex_wrapper(server_http_context::handler_t
}
int main(int argc, char ** argv) {
std::setlocale(LC_NUMERIC, "C");
// own arguments required by this example
common_params params;