Consommer nourriture, suite #168
This commit is contained in:
@ -47,7 +47,11 @@ export class Misc {
|
||||
const parsed = parseInt(value);
|
||||
return isNaN(parsed) ? 0 : parsed;
|
||||
}
|
||||
|
||||
static keepDecimals(num, decimals) {
|
||||
if (decimals<=0 || decimals>6) return num;
|
||||
const decimal = Math.pow(10, parseInt(decimals));
|
||||
return Math.round(num * decimal) / decimal;
|
||||
}
|
||||
static getFractionHtml(diviseur) {
|
||||
if (!diviseur || diviseur <= 1) return undefined;
|
||||
switch (diviseur || 1) {
|
||||
|
Reference in New Issue
Block a user