Skip to content

Amount

multiply

1.0.0

Multiplies an amount by a factor.

amount.multiply(/factor/, <rounding>);
  • Returns a single Amount as result
  • Accepts fractional and whole number factors
  • Simple and intuitive API
  • Comprehensive testing
ArgTypeDefault ValueRequired
factornumber-Yes
roundingmath | bankmathNo

From an initial Amount instance, use the multiply() method using a number factor to multiply the amount.

import { amount } from '@inpulse-ui/utils';
const result = amount(100.00, 'USD').multiply(2.5);
console.log(result); // Results an Amount instance with value 250 USD

This method also accepts fractional factors (e.g., 0.5 to halve the amount).

const result = amount(100.00, 'USD').multiply(0.5); // Results 50 USD

It also supports multiplying by the reciprocal of a number (e.g., 1/4 to quarter the amount).

const result = amount(100.00, 'USD').multiply(1/4); // Results 25 USD

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.