https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21507

--- Comment #22 from Raphael Straub <[email protected]> ---
(In reply to Victor Grousset/tuxayo from comment #21)
> (In reply to Katrin Fischer from comment #20)
> > Could it be an option to use a library here? Someone has mentioned
> > ICU::Number to me, but I am not sure of the functionality.
> 
> That would be great, ICU is the kind of project that should already provide
> an implementation for must stuff regarding this. Instead of trying in invent
> something to cover all cases and have it ruin by a new case. >_< (that's a
> lot of the story of this and bug 12310)
> 
> > ICU::Number
> 
> Where is it? The closest thing I found is
> https://metacpan.org/dist/Unicode-ICU
> and there is no sign of number formatting.

Unfortunately, the NumberFormatter is not part of this package [1], but perhaps
we could use MessageFormat [2] for number formatting, e.g.

my $formatter = Unicode::ICU::MessageFormat->new('en');
my $chars = $formatter->format('{0, number, currency}', [123.4]);
my $chars = $formatter->format('{0, number, :: .00}', [123.4]);

See [3] and [4] for an explanation of the format string.

[1] https://metacpan.org/release/CPANEL/Unicode-ICU-0.06/source/README.md
[2] https://metacpan.org/pod/Unicode%3A%3AICU%3A%3AMessageFormat
[3]
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1MessageFormat.html#patterns
[4]
https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to