(fix) Non decimal number in inventory table has commas [gl_SCI_10086]

This commit is contained in:
Gregor Lasnibat 2024-01-29 14:36:57 +01:00
parent 4a13476b90
commit 71bbe02eba
3 changed files with 4 additions and 4 deletions

View file

@ -162,9 +162,9 @@ $.fn.dataTable.render.defaultRepositoryNumberValue = function() {
return '';
};
$.fn.dataTable.render.RepositoryNumberValue = function(data) {
$.fn.dataTable.render.RepositoryNumberValue = function (data) {
return `<span class="number-value" data-value="${data.value}">
${data.value.toLocaleString('en-US', { timeZone: 'UTC' })}
${data.value}
</span>`;
};

View file

@ -33,7 +33,7 @@
'max-h-[4rem]': collapsed,
'max-h-[40rem]': !collapsed
}">
{{ colVal.toLocaleString('en-US', { timezone: 'UTC' }) }}
{{ colval }}
</div>
<div v-else
class="text-sn-dark-grey font-inter text-sm font-normal leading-5">

View file

@ -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)
value_object.data.round(value_object.data.scale.zero? ? 0 : decimals).to_s
end
end
end