Amount
multiply
1.0.0- Dependencies:
- ∟Direct: 0
- ∟Peer: 0
- Source code ↗
- Check on NPM ↗
Hidden
Overview
Section titled “Overview”Multiplies an amount by a factor.
amount.multiply(/factor/, <rounding>);Features
Section titled “Features”- Returns a single
Amountas result - Accepts fractional and whole number factors
- Simple and intuitive API
- Comprehensive testing
Arguments
Section titled “Arguments”| Arg | Type | Default Value | Required |
factor | number | - | Yes |
rounding | math | bank | math | No |
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 USDThis method also accepts fractional factors (e.g., 0.5 to halve the amount).
const result = amount(100.00, 'USD').multiply(0.5); // Results 50 USDIt 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 USDBuilt with by Jo Santana in Brazil.
© 2026 Inpulse. All rights reserved.