Merge branch 'Aufinal/arrondi_ukf' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/arrondi_ukf

This commit is contained in:
Ludovic Stephan 2016-12-22 00:25:07 -02:00
commit 38dbebb05e
2 changed files with 3 additions and 3 deletions

View file

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

View file

@ -9,6 +9,7 @@ from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.core.cache import cache
from kfet.models import Settings
from math import floor
import re
register = template.Library()
@ -37,5 +38,4 @@ def highlight_clipper(clipper, q):
@register.filter()
def ukf(balance, is_cof):
grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1
# float nécessaire car sinon problème avec le round de future.builtins
return round(float(balance * 10 * grant))
return floor(balance * 10 * grant)