forked from DGNum/gestioCOF
replace round by floor
This commit is contained in:
parent
d559549c06
commit
98886f422a
2 changed files with 3 additions and 2 deletions
|
@ -39,7 +39,7 @@ function amountDisplay(amount, is_cof=false, tri='') {
|
||||||
|
|
||||||
function amountToUKF(amount, is_cof=false) {
|
function amountToUKF(amount, is_cof=false) {
|
||||||
var coef_cof = is_cof ? 1 + settings['subvention_cof'] / 100 : 1;
|
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) {
|
function isValidTrigramme(trigramme) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ from django.utils.html import escape
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from kfet.models import Settings
|
from kfet.models import Settings
|
||||||
|
from math import floor
|
||||||
import re
|
import re
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
@ -38,4 +39,4 @@ def highlight_clipper(clipper, q):
|
||||||
def ukf(balance, is_cof):
|
def ukf(balance, is_cof):
|
||||||
grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1
|
grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1
|
||||||
# float nécessaire car sinon problème avec le round de future.builtins
|
# 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))
|
||||||
|
|
Loading…
Reference in a new issue