mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix credit test.
This commit is contained in:
@@ -99,7 +99,7 @@ class Amount implements ConverterInterface
|
|||||||
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $original, $value));
|
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $original, $value));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (string)number_format(round(floatval($value), 12), 12, '.', '');
|
return number_format(round((float)$value, 12), 12, '.', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,7 +37,7 @@ class AmountCreditTest extends TestCase
|
|||||||
{
|
{
|
||||||
$values = [
|
$values = [
|
||||||
'0' => '0.000000000000',
|
'0' => '0.000000000000',
|
||||||
'0.0' => '0',
|
'0.0' => '0.000000000000',
|
||||||
'0.1' => '0.1',
|
'0.1' => '0.1',
|
||||||
'.2' => '0.2',
|
'.2' => '0.2',
|
||||||
'0.01' => '0.01',
|
'0.01' => '0.01',
|
||||||
@@ -154,7 +154,7 @@ class AmountCreditTest extends TestCase
|
|||||||
foreach ($values as $value => $expected) {
|
foreach ($values as $value => $expected) {
|
||||||
$converter = new AmountCredit;
|
$converter = new AmountCredit;
|
||||||
$result = $converter->convert($value);
|
$result = $converter->convert($value);
|
||||||
$this->assertEquals($expected, $result, sprintf('The original value was %s', $value));
|
$this->assertEquals($expected, $result, sprintf('The original value was %s, expected was %s', $value, $expected));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user