Код: Выделить всё
$provider->setExchangeRate($baseCurrencyCharCode, $currencyCharCode, $currencyTableRow->value );
$converter = new CurrencyConverter($provider);
$money = Money::of($amount, $baseCurrencyCharCode);
$value = $converter->convert($money, $currencyCharCode, roundingMode: RoundingMode::DOWN);
dd( BigDecimal::of($value->getAmount()) );
Код: Выделить всё
Brick\Math\BigDecimal {#1678 ▼ // app/Library/Services/BrickMoneyConverter.php:61
-value: "7340"
-scale: 2
}
Кажется, эта библиотека умеет работать с весами?
Код: Выделить всё
"brick/money": "^0.9.0"
"laravel/framework": "^11.9",
php 8.2
Подробнее здесь: https://stackoverflow.com/questions/790 ... bigdecimal