Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 1x 1x 1x 1x 67x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 68x 1x | import { AmaliaFunctionCategory, AmaliaFunctionKeys, type AmaliaFormula } from '@amalia/amalia-lang/formula/types';
import { AmaliaFunctionDefault } from '../../AmaliaFunction';
export const numbersMod = new AmaliaFunctionDefault<[number, number], number>({
name: AmaliaFunctionKeys.MOD,
category: AmaliaFunctionCategory.NUMBERS,
nbParamsRequired: 2,
description: 'Return the remainder of a division',
exec: (divident, divisor) => divident % divisor,
params: [
{ name: 'dividend', description: 'Dividend: numbers, fields, properties, variables' },
{ name: 'divisor', description: 'Divisor: numbers, fields, properties, variables' },
],
examples: [
{
desc: 'Returns 2.',
formula: 'MOD(8, 3)' as AmaliaFormula,
result: 2,
},
{
desc: 'Returns 0.',
formula: 'MOD(10, 2)' as AmaliaFormula,
result: 0,
},
{
desc: 'Returns the remainder of Amount divided by 2.',
formula: 'MOD(opportunity.amount, 2)',
},
],
});
|