rich-domain
Version:
This package provide utils file and interfaces to assistant build a complex application with domain driving design
22 lines • 1.02 kB
TypeScript
/**
* @description Multiplies two numbers (`valueA` and `valueB`) with validation, normalization,
* and optional precision adjustment. Handles edge cases where the inputs are not valid numbers.
*
* @param valueA The first value to multiply. Can be a number or a value convertible to a number.
* @param valueB The second value to multiply. Can be a number or a value convertible to a number.
* @param precision The number of decimal places to apply to the result. Defaults to 5.
*
* @returns The result of the multiplication, normalized and adjusted to the specified precision.
* Returns `0` if either value is not a valid number.
*
* @example
* ```typescript
* Multiply(10, 2); // Returns 20
* Multiply(10, 2.5, 2); // Returns 25.00
* Multiply("10", "3"); // Returns 30 (handles string inputs)
* Multiply(NaN, 2); // Returns 0
* ```
*/
export declare const Multiply: (valueA: number, valueB: number, precision?: number) => number;
export default Multiply;
//# sourceMappingURL=multiply-number.util.d.ts.map