]> git.koha-community.org Git - koha.git/commit
Bug 19759: Make TestBuilder generates only 2 decimals for float
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Dec 2017 16:03:15 +0000 (13:03 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 20 Dec 2017 11:56:36 +0000 (11:56 +0000)
commite8a3bf7cd17b181904dcc324099c555e7c5cc518
treec9ea630fc2d90a13322f632f8028a0fadc2ae073
parent0c21c2a5c23d522737b8a0c27f6dc3a655a9dfbb
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.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
t/db_dependent/TestBuilder.t
t/lib/TestBuilder.pm