UConv: use SI standard for thousands_sep

git-svn-id: https://svn.fhem.de/fhem/trunk@19618 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
loredo
2019-06-14 12:02:14 +00:00
parent b2b8a6f925
commit b265a0fc89

View File

@@ -9,6 +9,7 @@ package UConv;
use strict;
use warnings;
use POSIX;
use utf8;
use Math::Trig;
use Scalar::Util qw(looks_like_number);
@@ -2102,12 +2103,11 @@ sub decimal_mark ($;$) {
setlocale( LC_NUMERIC, $old_locale );
no locale;
$thousands_sep = ($decimal_point && $decimal_point eq ',' ? '.' : ',')
unless ($thousands_sep);
$thousands_sep = chr(0x2009) unless ($thousands_sep);
my @grouping =
$grouping && $grouping =~ /^\d+$/ ? unpack( "C*", $grouping ) : (3);
if ( $thousands_sep eq '.' ) {
if ( $thousands_sep ne ',' ) {
$d =~ s/\./$decimal_point/g;
$d =~ s/(\d{$grouping[0]})(?=\d)(?!\d*,)/$1$thousands_sep/g;
}