From 3586d1504b7302dd1ce28940c393d0a1cc2c6457 Mon Sep 17 00:00:00 2001 From: =?utf8?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 Signed-off-by: Mirko Tietgen Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- Koha/Number/Price.pm | 13 +++++++++++++ .../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 331e3c33e8..21d964315e 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 0c924b4530..26ec49a4dd 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 -- 2.20.1