Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Multiply unit by numeric factor #14

Open
neilcrookes opened this issue Feb 19, 2020 · 0 comments
Open

Enhancement: Multiply unit by numeric factor #14

neilcrookes opened this issue Feb 19, 2020 · 0 comments

Comments

@neilcrookes
Copy link
Contributor

neilcrookes commented Feb 19, 2020

E.g.

/* You can multiply a unit by calling `multiply` method with a float as an argument
 * add always returns a new instance
 */
$quantity = 7;
$unitWeight = new Mass\Gram(500);
$totalWeight = $unitWeight->multiply($quantity);
echo $totalWeight->format(0);
// 3500 g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants