From 34e6fbff80ab9b4417b862078b1f77392bb71fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Sat, 18 Jun 2016 08:17:03 +0200 Subject: [PATCH] Bug 16768 - Add official number format for Switzerland: 1'234'567.89 This patch adds the official number format for Switzerland (CH) and makes it selectable in syspref 'CurrencyFormat' To test: - Apply patch - Set syspref 'CurrencyFormat' to '360'000.00 (CH)' - Go to Home > Administration > Budgets administration - Create or edit a budget with Total amount of 1234567.89 - Verify that the amount appears properly formated as 1'234'567.89 --- Koha/Number/Price.pm | 13 +++++++++++++ .../prog/en/modules/admin/preferences/acquisitions.pref | 1 + 2 files changed, 14 insertions(+) diff --git a/Koha/Number/Price.pm b/Koha/Number/Price.pm index 331e3c3..21d9643 100644 --- a/Koha/Number/Price.pm +++ b/Koha/Number/Price.pm @@ -105,6 +105,19 @@ sub _format_params { ); } + if ( $currency_format eq 'CH' ) { + $int_curr_symbol = $currency->symbol if $with_symbol; + %format_params = ( + decimal_fill => '2', + decimal_point => '.', + int_curr_symbol => $int_curr_symbol, + mon_thousands_sep => '\'', + thousands_sep => '\'', + mon_decimal_point => '.' + ); + } + + $format_params{p_cs_precedes} = $p_cs_precedes if defined $p_cs_precedes; $format_params{p_sep_by_space} = ( $int_curr_symbol and defined $p_sep_by_space ) ? $p_sep_by_space : 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 0c924b4..26ec49a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -32,6 +32,7 @@ Acquisitions: choices: US: 360,000.00 (US) FR: 360 000,00 (FR) + CH: 360'000.00 (CH) - - Tax rates are - pref: gist -- 1.7.10.4