mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for import correcting amounts
This commit is contained in:
parent
ac763b3a0a
commit
4ca034c9f6
@ -146,7 +146,7 @@ class BaseTransformer
|
||||
$number = 0;
|
||||
}
|
||||
|
||||
return Number::parseStringFloat($number);
|
||||
return Number::parseFloat($number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,27 @@ class NumberTest extends TestCase
|
||||
$this->assertEquals(2.15, $rounded);
|
||||
}
|
||||
|
||||
//this method proved an error! removing this method from production
|
||||
// public function testImportFloatConversion()
|
||||
// {
|
||||
|
||||
// $amount = '€7,99';
|
||||
|
||||
// $converted_amount = Number::parseStringFloat($amount);
|
||||
|
||||
// $this->assertEquals(799, $converted_amount);
|
||||
|
||||
// }
|
||||
|
||||
public function testParsingStringCurrency()
|
||||
{
|
||||
$amount = '€7,99';
|
||||
|
||||
$converted_amount = Number::parseFloat($amount);
|
||||
|
||||
$this->assertEquals(7.99, $converted_amount);
|
||||
}
|
||||
|
||||
// public function testParsingFloats()
|
||||
// {
|
||||
// Currency::all()->each(function ($currency) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user