From 0c2e2797303bad824b8582d3351e3926e2ee68e9 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Sat, 13 Apr 2024 01:46:44 +0400 Subject: [PATCH] Maintain decimal precision in "Number" column type for 0 inputs [SCI-10202]" --- .../repository_datatable/repository_number_value_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/repository_datatable/repository_number_value_serializer.rb b/app/serializers/repository_datatable/repository_number_value_serializer.rb index eaccc1dab..0b3ab792e 100644 --- a/app/serializers/repository_datatable/repository_number_value_serializer.rb +++ b/app/serializers/repository_datatable/repository_number_value_serializer.rb @@ -4,7 +4,7 @@ module RepositoryDatatable class RepositoryNumberValueSerializer < RepositoryBaseValueSerializer def value decimals = scope[:column].metadata.fetch('decimals', Constants::REPOSITORY_NUMBER_TYPE_DEFAULT_DECIMALS).to_i - value_object.data.round(value_object.data.scale.zero? ? 0 : decimals).to_s + value_object.data.round(decimals).to_s end end end