use var for repeatitive calculation
parent
81f6f0129c
commit
0a12f5470a
|
@ -96,12 +96,13 @@ export class CampaignPlayerDetailComponent implements OnInit {
|
|||
this.reviveData = this.assignData(this.yAxisRevive, 'revive');
|
||||
this.captureData = this.assignData(this.yAxisCapture, 'flagTouch');
|
||||
|
||||
this.kdRatio = parseFloat((this.totalKills / (this.totalDeath === 0 ? 1 : this.totalDeath)).toFixed(2));
|
||||
const totalDeathDiv = this.totalDeath === 0 ? 1 : this.totalDeath;
|
||||
this.kdRatio = parseFloat((this.totalKills / totalDeathDiv).toFixed(2));
|
||||
if (this.kdRatio > 1) {
|
||||
this.maxKd = this.kdRatio * 1.7;
|
||||
}
|
||||
|
||||
this.respawnDeathRatio = parseFloat((this.totalRespawn / (this.totalDeath === 0 ? 1 : this.totalDeath)).toFixed(2));
|
||||
this.respawnDeathRatio = parseFloat((this.totalRespawn / totalDeathDiv).toFixed(2));
|
||||
|
||||
this.sumData = [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue