For instance items.replacementprice is decimal(8,2) but more than 2 decimals are generated. It leads to issues when we compare expected objects: # got: '135623.866142537' # expected: '135623.87'
Created attachment 69562 [details] [review] Bug 19759: Make TestBuilder generates only 2 decimals for float For instance items.replacementprice is decimal(8,2) but more than 2 decimals are generated. It leads to issues when we compare expected objects: # got: '135623.866142537' # expected: '135623.87' Test plan: prove t/db_dependent/TestBuilder.t must return green
Created attachment 69566 [details] [review] Bug 19759: Make TestBuilder generates only 2 decimals for float For instance items.replacementprice is decimal(8,2) but more than 2 decimals are generated. It leads to issues when we compare expected objects: # got: '135623.866142537' # expected: '135623.87' Test plan: prove t/db_dependent/TestBuilder.t must return green
Created attachment 69666 [details] [review] Bug 19759: Make TestBuilder generates only 2 decimals for float For instance items.replacementprice is decimal(8,2) but more than 2 decimals are generated. It leads to issues when we compare expected objects: # got: '135623.866142537' # expected: '135623.87' Test plan: prove t/db_dependent/TestBuilder.t must return green Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Created attachment 69821 [details] [review] Bug 19759: Make TestBuilder generates only 2 decimals for float For instance items.replacementprice is decimal(8,2) but more than 2 decimals are generated. It leads to issues when we compare expected objects: # got: '135623.866142537' # expected: '135623.87' Test plan: prove t/db_dependent/TestBuilder.t must return green Signed-off-by: Dominic Pichette <dominic@inlibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Somehow I have the feeling that we should allow more decimals sometimes and perhaps have a number of decimals parameter or so. Think of fields like currency or discount. But the current issues justify this change.
(In reply to Marcel de Rooy from comment #4) > like currency or discount. currency rate
Pushed to master for 18.05, thanks to everybody involved!
Created attachment 69861 [details] [review] Bug 19759: Fix failing test in Chargelostitem.t t/db_dependent/Circulation/Chargelostitem.t .. 1/6 # Failed test 'The accountline amount should be precessfee value ' # at t/db_dependent/Circulation/Chargelostitem.t line 71. # got: '4.5968041848873e+20' # expected: '459680418488730451968.00' Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Last patch pushed to master.
Awesome work all! Pushed to stable for 17.11.01