Fix rounding issues.

This commit is contained in:
James Cole 2023-05-15 06:33:30 +02:00
parent cf7c01e5d0
commit 4706cd44de
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 2 additions and 2 deletions

View File

@ -300,7 +300,7 @@ class UpdateRequest extends FormRequest
if (array_key_exists($fieldName, $transaction)) {
$value = $transaction[$fieldName];
if (is_float($value)) {
$current[$fieldName] = sprintf('%.24f', $value);
$current[$fieldName] = sprintf('%.12f', $value);
}
if (!is_float($value)) {
$current[$fieldName] = (string)$value;

View File

@ -351,7 +351,7 @@ class Steam
}
// if the number contains "E", it's in scientific notation, so we need to convert it to a normal number first.
if (false !== stripos($number, 'e')) {
$number = sprintf('%.24f', $number);
$number = sprintf('%.12f', $number);
}
// Log::debug(sprintf('Trying bcround("%s",%d)', $number, $precision));