Truffles
Truffles

Reputation: 13

Is there a function like "bcadd" except it performs multiplication?

I'm hoping to do some math operations on numbers being represented as strings. So far, I haven't found anything that could do multiplication.

Thanks!

Upvotes: 1

Views: 576

Answers (3)

Scuzzy
Scuzzy

Reputation: 12332

http://www.php.net/manual/en/function.bcmul.php

bcmul — Multiply two arbitrary precision number

string bcmul ( string $left_operand , string $right_operand [, int $scale ] )

Multiply the left_operand by the right_operand.

Upvotes: 0

David Rodrigues
David Rodrigues

Reputation: 12542

You need of the bcmul() method. You too can take a look on BC Math functions.

Example:

echo bcmul('2.123456', '4.7891011', 6); // 6 is the precision

Upvotes: 3

jwodder
jwodder

Reputation: 57540

You mean bcmul?

Upvotes: 0

Related Questions