@typia/website
    Preparing search index...

    Type Alias MultipleOf<Value>

    MultipleOf: tags.TagBase<
        {
            exclusive: true;
            kind: "multipleOf";
            schema: Value extends bigint
                ? { multipleOf: Numeric<Value> }
                : { multipleOf: Value };
            target: Value extends bigint ? "bigint" : "number";
            validate: `$input % ${Cast<Value>} === ${Value extends bigint
                ? Cast<0n>
                : 0}`;
            value: Value;
        },
    >

    Multiple of constraint tag.

    Enforces that a numeric value must be an exact multiple of the specified divisor. This constraint validates that the input value satisfies: input % divisor === 0.

    Example usage:

    type EvenNumber = number & tags.MultipleOf<2>; // Must be even (2, 4, 6, ...)
    type DollarAmount = number & tags.MultipleOf<0.01>; // Must be in cents

    Common use cases include validating even/odd numbers, currency amounts, time intervals, or any value that must align to specific increments.

    Type Parameters

    • Value extends number | bigint

      The divisor value that input must be a multiple of (number or bigint literal)

    Jeongho Nam - https://github.com/samchon