Browse Source

use math.floor method instead of toFixed()

pull/19203/head
Sinan Öztürk 2 years ago
parent
commit
d7fa0f5c36
  1. 7
      npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts

7
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts

@ -178,7 +178,12 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
ngOnChanges({ data, recordsTotal }: SimpleChanges) {
if (data?.currentValue.length < 1 && recordsTotal?.currentValue > 0) {
let maxPage = Number(Number(recordsTotal?.currentValue / this.list.maxResultCount).toFixed());
let maxPage = Math.floor(Number(Number(recordsTotal?.currentValue / this.list.maxResultCount)));
if(recordsTotal?.currentValue < this.list.maxResultCount) {
this.list.page = 0;
return;
}
if (recordsTotal?.currentValue % this.list.maxResultCount === 0) {
maxPage -= 1;

Loading…
Cancel
Save