Skip to content

Enhancement: Multiply unit by numeric factor #14

@neilcrookes

Description

@neilcrookes

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions