wrong LC_NUMBERIC cause CSS unsupported value

warning: unsupported value
position: absolute; width: 12.9em; transform: translateX(16.27em);
^

and you know, some countries uses decimal point as comma - not point.
so scanf function cannot read "12.9em" if we set NUMERIC at that country.
Such as French.

// query LC_NUMERIC
char* locale = setlocale(LC_NUMERIC, NULL);
// set LC_NUMERIC
char* locale = "en_US.utf8";
setlocale(LC_NUMERIC, locale);

if LC_NUMERIC was set to "frCA.UTF-8",
12.9em can't be read as a Decimal.
The correct should be like "en_US.utf8"

Refer:
https://en.wikipedia.org/wiki/Decimal_mark
http://man7.org/linux/man-pages/man3/setlocale.3.html

Subscribe to Post, Code and Quiet Time.

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe