different rounding for accounts

This commit is contained in:
Ludovic Stephan 2017-02-12 19:05:41 -02:00
parent 8d0f803639
commit 3fa0e4de6c
2 changed files with 11 additions and 10 deletions

View file

@ -37,9 +37,10 @@ function amountDisplay(amount, is_cof=false, tri='') {
return amountToUKF(amount, is_cof);
}
function amountToUKF(amount, is_cof=false) {
function amountToUKF(amount, is_cof=false, account=false) {
var rounding = account ? Math.floor : Math.round ;
var coef_cof = is_cof ? 1 + settings['subvention_cof'] / 100 : 1;
return Math.round(amount * coef_cof * 10);
return rounding(amount * coef_cof * 10);
}
function isValidTrigramme(trigramme) {