replace round by floor

This commit is contained in:
Ludovic Stephan 2016-11-23 01:39:31 -02:00
parent d559549c06
commit 98886f422a
2 changed files with 3 additions and 2 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()
@ -38,4 +39,4 @@ def highlight_clipper(clipper, q):
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(float(balance * 10 * grant))